Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 12 commits
  • 69 files changed
  • 0 commit comments
  • 7 contributors
Commits on Aug 16, 2013
@piuccio piuccio fix #674 404 link in Doc a1a88b5
Commits on Aug 21, 2013
@jakub-g jakub-g fix #676 bump dependencies
Build was failing due to jshint / contrib-jshint incompatibility.
73847b5
Commits on Aug 22, 2013
@divdavem divdavem fix #678 Work-around for scrollbars not removed correctly on webkit.
Adds an aria.utils.Dom.refreshScrollbars method as a work-around
for Chrome bug http://crbug.com/240772 (this bug also appears on
some other webkit browsers) : scrollbars are not removed when they
are no longer necessary if the content has nearly the same size as
the container.
661c880
Commits on Aug 23, 2013
@jakub-g jakub-g Revert "fix #639 too small viewport size reported in IE8"
This reverts commit cd6a255
which landed in 1.4.8 and 1.3.7F.

That commit caused some problems with unnecessary scrollbars in IE8.
Instead, a commit from #675 was incorporated to address the issue.
636de6f
@jakub-g jakub-g fix #675 Dialog disappears after resize
When the viewport was resized significantly, so that dialogOldPosition.left
> newViewport.width, the Dialog disappeared and never appeared again.

The problem was introduced in e6405a1 by
the check if reference position is in viewport before displaying the
popup. However this check is valid only in reaction to scrolling events.

The check is now performed only in the onmousewheel event listener.
572fa1e
@divdavem divdavem feat #681 Add support for the Hebrew language
This commit adds resource files for the Hebrew language.

Additionally, as in Hebrew using substring to produce the short day
name from the full day name does not work (because all days start
with the same letters), this commit adds the ability to define a
custom short name for days and months. If there is no custom short
name in a resource file, the default mechanism with substring is used.

Close #681
ae05348
Commits on Aug 26, 2013
@jakub-g jakub-g fix #670 add ko_KR, zh_CN, tw_CN, ar_SA locales
ko_KO, cn_CN, tw_TW, sp_AR locales are deprecated and will be removed in
the future.

Close #669.
3883da9
@jakub-g jakub-g fix #683 touch dialog events test randomly fails 1647274
Commits on Aug 27, 2013
renju richard feat #652 Autocomplete Eventhandlers cbfeba9
Commits on Aug 28, 2013
@olaf-k olaf-k fix #666 History Manager state not updated when replacing page 901119b
@fab-b fab-b fix #45 autocomplete : Issues with autocomplete Expand button
this commit aims to fix a problem inside autocomplete widget with the expand button
e432fb6
Commits on Aug 30, 2013
@flongo flongo v1.4.9 f30209f
Showing with 1,537 additions and 74 deletions.
  1. +1 −1  CONTRIBUTING.md
  2. +1 −1  bower.json
  3. +3 −3 build/config/locales.json
  4. +4 −4 package.json
  5. +17 −0 src/aria/core/ResClassLoader.js
  6. +11 −1 src/aria/pageEngine/utils/HistoryManager.js
  7. +19 −19 src/aria/popups/Popup.js
  8. +25 −0 src/aria/resources/CalendarRes_ar_SA.js
  9. +25 −0 src/aria/resources/CalendarRes_he_IL.js
  10. +25 −0 src/aria/resources/CalendarRes_ko_KR.js
  11. +25 −0 src/aria/resources/CalendarRes_zh_CN.js
  12. +25 −0 src/aria/resources/CalendarRes_zh_TW.js
  13. +4 −0 src/aria/resources/DateRes.js
  14. +51 −0 src/aria/resources/DateRes_ar_SA.js
  15. +4 −0 src/aria/resources/DateRes_cn_CN.js
  16. +4 −0 src/aria/resources/DateRes_da_DK.js
  17. +4 −0 src/aria/resources/DateRes_de_DE.js
  18. +4 −0 src/aria/resources/DateRes_en_GB.js
  19. +4 −0 src/aria/resources/DateRes_en_US.js
  20. +4 −0 src/aria/resources/DateRes_es_ES.js
  21. +4 −0 src/aria/resources/DateRes_fi_FI.js
  22. +4 −0 src/aria/resources/DateRes_fr_FR.js
  23. +57 −0 src/aria/resources/DateRes_he_IL.js
  24. +4 −0 src/aria/resources/DateRes_is_IS.js
  25. +4 −0 src/aria/resources/DateRes_it_IT.js
  26. +4 −0 src/aria/resources/DateRes_ja_JP.js
  27. +4 −0 src/aria/resources/DateRes_ko_KO.js
  28. +52 −0 src/aria/resources/DateRes_ko_KR.js
  29. +4 −0 src/aria/resources/DateRes_nl_NL.js
  30. +4 −0 src/aria/resources/DateRes_no_NO.js
  31. +4 −0 src/aria/resources/DateRes_pl_PL.js
  32. +4 −0 src/aria/resources/DateRes_pt_BR.js
  33. +4 −0 src/aria/resources/DateRes_pt_PT.js
  34. +4 −0 src/aria/resources/DateRes_ru_RU.js
  35. +4 −0 src/aria/resources/DateRes_sp_AR.js
  36. +4 −0 src/aria/resources/DateRes_sv_SE.js
  37. +4 −0 src/aria/resources/DateRes_th_TH.js
  38. +4 −0 src/aria/resources/DateRes_tk_TK.js
  39. +4 −0 src/aria/resources/DateRes_tr_TR.js
  40. +4 −0 src/aria/resources/DateRes_tw_TW.js
  41. +51 −0 src/aria/resources/DateRes_zh_CN.js
  42. +51 −0 src/aria/resources/DateRes_zh_TW.js
  43. +26 −0 src/aria/resources/multiselect/FooterRes_ar_SA.js
  44. +4 −4 src/aria/resources/multiselect/FooterRes_he_IL.js
  45. +26 −0 src/aria/resources/multiselect/FooterRes_ko_KR.js
  46. +26 −0 src/aria/resources/multiselect/FooterRes_zh_CN.js
  47. +26 −0 src/aria/resources/multiselect/FooterRes_zh_TW.js
  48. +2 −1  src/aria/templates/Layout.js
  49. +11 −3 src/aria/utils/Date.js
  50. +65 −17 src/aria/utils/Dom.js
  51. +8 −0 src/aria/widgets/CfgBeans.js
  52. +2 −2 src/aria/widgets/controllers/AutoCompleteController.js
  53. +9 −2 src/aria/widgets/form/TextInput.js
  54. +5 −1 test/aria/pageEngine/utils/BaseNavigationManagerTest.js
  55. +18 −0 test/aria/pageEngine/utils/HistoryManagerTest.js
  56. +15 −13 test/aria/touch/widgets/dialog/events/DialogEventsTestCase.js
  57. +19 −1 test/aria/utils/Dom.js
  58. +47 −0 test/aria/widgets/container/dialog/viewportResize/ViewportHugeShrinkTemplate.tpl
  59. +119 −0 test/aria/widgets/container/dialog/viewportResize/ViewportHugeShrinkTestCase.js
  60. +1 −0  test/aria/widgets/form/autocomplete/AutoCompleteTestSuite.js
  61. +153 −0 test/aria/widgets/form/autocomplete/expandbutton/test4/ExpandButtonCheck.js
  62. +43 −0 test/aria/widgets/form/autocomplete/expandbutton/test4/ExpandButtonCheckTpl.tpl
  63. +50 −0 test/aria/widgets/form/autocomplete/expandbutton/test4/ExpandButtonCheckTplScript.js
  64. +3 −1 test/aria/widgets/form/textinput/TextInputTestSuite.js
  65. +80 −0 test/aria/widgets/form/textinput/onclick/OnClickTemplate.tpl
  66. +50 −0 test/aria/widgets/form/textinput/onclick/OnClickTemplateScript.js
  67. +71 −0 test/aria/widgets/form/textinput/onclick/OnClickTest.js
  68. +80 −0 test/aria/widgets/form/textinput/onfocus/OnFocusTemplate.tpl
  69. +35 −0 test/aria/widgets/form/textinput/onfocus/OnFocusTest.js
View
2  CONTRIBUTING.md
@@ -44,7 +44,7 @@ Good code is
- documented
We put lot of effort into write good code, so should you!
-Be sure to follow our [guidelines](http://ariatemplates.com/usermanual/Code_Standards).
+Be sure to follow our [guidelines](http://ariatemplates.com/usermanual/latest/code_standards.html).
__We won't accept code without a proper test__. You were warned!
If you want to know more about testing Aria Templates code, please have a look at the [README](test/README.md) file in _test_ folder.
View
2  bower.json
@@ -1,6 +1,6 @@
{
"name": "ariatemplates",
- "version": "1.4.8",
+ "version": "1.4.9",
"main": "src/aria/bootstrap.js",
"ignore": [
"**/.*",
View
6 build/config/locales.json
@@ -1,3 +1,3 @@
-["cn_CN", "da_DK", "en_GB", "en_US", "es_ES", "fi_FI", "fr_FR", "is_IS", "it_IT", "ja_JP", "ko_KO", "nl_NL", "no_NO",
- "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sp_AR", "sv_SE", "th_TH", "tr_TR", "tw_TW", "de_DE", "tk_TK", "ca_ES",
- "el_GR", "fo_FO", "he_IL", "hi_IN", "hu_HU"]
+["cn_CN", "zh_CN", "da_DK", "en_GB", "en_US", "es_ES", "fi_FI", "fr_FR", "is_IS", "it_IT", "ja_JP", "ko_KO", "ko_KR", "nl_NL", "no_NO",
+ "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sp_AR", "ar_SA", "sv_SE", "th_TH", "tr_TR", "tw_TW", "zh_TW", "de_DE", "tk_TK", "ca_ES",
+ "el_GR", "fo_FO", "he_IL", "hi_IN", "hu_HU"]
View
8 package.json
@@ -2,7 +2,7 @@
"author": "ariatemplates <contact@ariatemplates.com> (http://github.com/ariatemplates)",
"name": "ariatemplates",
"description": "Aria Templates (aka AT) is an application framework written in JavaScript for building rich and large-scaled enterprise web applications.",
- "version": "1.4.8",
+ "version": "1.4.9",
"homepage": "http://ariatemplates.com",
"repository": {
"type": "git",
@@ -27,10 +27,10 @@
"grunt-verifylowercase": "0.2.0",
"grunt-leading-indent": "0.1.0",
"grunt": "git+https://github.com/divdavem/grunt.git#13da751bdfd291c25a47ca7669ae0778eb289b28",
- "grunt-contrib-jshint": "0.6.0",
+ "grunt-contrib-jshint": "0.6.3",
"attester": "1.2.0",
- "express": "3.3.1",
- "jade": "0.32.0",
+ "express": "3.3.5",
+ "jade": "0.34.1",
"atpackager": "0.1.0",
"mocha": "1.11.0"
}
View
17 src/aria/core/ResClassLoader.js
@@ -31,6 +31,16 @@ Aria.classDefinition({
$statics : {
REGEXP : /Aria\.resourcesDefinition\(/,
+ /* BACKWARD-COMPATIBILITY-BEGIN GH-669 */
+ DEPRECATED_LOCALES : {
+ "sp_AR" : "ar_SA",
+ "ko_KO" : "ko_KR",
+ "cn_CN" : "zh_CN",
+ "tw_TW" : "zh_TW"
+ },
+ DEPRECATED_LOCALES_WARNING : "The locale %1 is deprecated and will be removed soon, please use %2 locale instead.",
+ /* BACKWARD-COMPATIBILITY-END GH-669 */
+
// ERROR MESSAGES:
RESOURCE_NOT_FOUND : "Error: the resource file '%1' for '%2' locale was not found",
RESOURCE_NOT_RESOLVED : "Error: No resource file for '%1' could be found"
@@ -120,6 +130,13 @@ Aria.classDefinition({
// Get the locale
var resLocale = aria.core.ResMgr.currentLocale;
+ /* BACKWARD-COMPATIBILITY-BEGIN GH-669 */
+ if (resLocale in this.DEPRECATED_LOCALES) {
+ var newLocale = this.DEPRECATED_LOCALES[resLocale];
+ this.$logWarn(this.DEPRECATED_LOCALES_WARNING, [resLocale, newLocale]);
+ }
+ /* BACKWARD-COMPATIBILITY-END GH-669 */
+
// Build the callback for the asynchronous method
var callback = {
fn : this.__loadParentDefinition,
View
12 src/aria/pageEngine/utils/HistoryManager.js
@@ -53,6 +53,14 @@ Aria.classDefinition({
"onpopstate" : this._onPopStateCallback
});
+ /**
+ * Whether a popstate event has just been raised. Useful in order to know if the update of the history
+ * information has to be done
+ * @type Boolean
+ * @protected
+ */
+ this._poppedState = false;
+
},
$destructor : function () {
this._history.$removeListeners({
@@ -72,6 +80,7 @@ Aria.classDefinition({
var url = this.getUrl();
var pageId = this._cache[url] ? this._cache[url].id : null;
if (pageId && this._navigate) {
+ this._poppedState = true;
this.$callback(this._navigate, {
pageId : pageId,
url : url,
@@ -88,13 +97,14 @@ Aria.classDefinition({
var url = pageRequest.url;
if (aria.utils.Type.isString(url)) {
this._addInCache(url, pageRequest.pageId);
- if (this.getUrl() != url) {
+ if (!this._poppedState) {
if (pageRequest.replace) {
this._history.replaceState(pageRequest.data, pageRequest.title, url);
} else {
this._history.pushState(pageRequest.data, pageRequest.title, url);
}
}
+ this._poppedState = false;
}
},
View
38 src/aria/popups/Popup.js
@@ -681,28 +681,22 @@ Aria.classDefinition({
} else {
this.computedStyle = this._getComputedStyle();
}
- // Need to check that the reference point is still completely visible after a scroll
- var referenceIsInViewSet = aria.utils.Dom.isInViewport(this.referencePosition, this.referenceSize, this.domElement);
- if (referenceIsInViewSet) {
- this.domElement.style.cssText = ['top:', this.computedStyle.top, 'px;', 'left:',
- this.computedStyle.left, 'px;', 'z-index:', this.computedStyle.zIndex, ';',
- 'position:absolute;display:inline-block;'].join('');
+ this.domElement.style.cssText = ['top:', this.computedStyle.top, 'px;', 'left:', this.computedStyle.left,
+ 'px;', 'z-index:', this.computedStyle.zIndex, ';', 'position:absolute;display:inline-block;'].join('');
- if (this.conf.animateIn) {
- this._startAnimation(this.conf.animateIn, {
- to : this.domElement,
- type : 1
- });
- }
-
- if (aria.core.Browser.isIE7 && !this.isOpen) {
- // Without the following line, the autocomplete does not
- // initially display its content on IE7:
- this._document.body.appendChild(this.domElement);
- }
+ if (this.conf.animateIn) {
+ this._startAnimation(this.conf.animateIn, {
+ to : this.domElement,
+ type : 1
+ });
+ }
+ if (aria.core.Browser.isIE7 && !this.isOpen) {
+ // Without the following line, the autocomplete does not initially display its content on IE7:
+ this._document.body.appendChild(this.domElement);
}
+
},
/**
@@ -851,8 +845,14 @@ Aria.classDefinition({
_isScrolling : function () {
var domReference = this.reference;
if (domReference) {
+
var geometry = aria.utils.Dom.getGeometry(domReference);
- if (geometry) {
+ var referenceIsInViewport = geometry && (aria.utils.Dom.isInViewport({
+ left : geometry.x,
+ top : geometry.y
+ }, geometry, this.domElement));
+
+ if (referenceIsInViewport) {
this.referencePosition = {
left : geometry.x,
top : geometry.y
View
25 src/aria/resources/CalendarRes_ar_SA.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for calendar ar_SA
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.CalendarRes',
+ $resources : {
+ today : "\u0627\u0644\u064a\u0648\u0645",
+ selectedDate : "\u0627\u0644\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0645\u062d\u062f\u062f"
+ }
+});
View
25 src/aria/resources/CalendarRes_he_IL.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for calendar he_IL
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.CalendarRes',
+ $resources : {
+ today : "\u05D4\u05D9\u05D5\u05DD",
+ selectedDate : "\u05EA\u05D0\u05E8\u05D9\u05DA \u05E9\u05E0\u05D1\u05D7\u05E8"
+ }
+});
View
25 src/aria/resources/CalendarRes_ko_KR.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for calendar ko_KR
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.CalendarRes',
+ $resources : {
+ today : "\uc624\ub298",
+ selectedDate : "\uc120\ud0dd\ud55c \ub0a0\uc9dc"
+ }
+});
View
25 src/aria/resources/CalendarRes_zh_CN.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for calendar zh_CN
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.CalendarRes',
+ $resources : {
+ today : "\u4eca\u5929",
+ selectedDate : "\u6240\u9009\u65e5\u671f"
+ }
+});
View
25 src/aria/resources/CalendarRes_zh_TW.js
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for calendar zh_TW
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.CalendarRes',
+ $resources : {
+ today : "\u4eca\u5929",
+ selectedDate : "\u9078\u64c7\u7684\u65e5\u671f"
+ }
+});
View
4 src/aria/resources/DateRes.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Friday",
"Saturday"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"January",
"February",
View
51 src/aria/resources/DateRes_ar_SA.js
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT FORMAT
+ * Aria resource object for dates ar_SA
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.DateRes',
+ $resources : {
+ day : [
+ "الأحد",
+ "الاثنين",
+ "الثلاثاء",
+ "الأربعاء",
+ "الخميس",
+ "الجمعة",
+ "السبت"
+ ],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
+ month : [
+ "يناير",
+ "فبراير",
+ "مار س",
+ "أبريل",
+ "مايو",
+ "يونيو",
+ "يوليو",
+ "أغسطس",
+ "سبتمبر",
+ "أكتوبر",
+ "نوفمبر",
+ "ديسمبر"
+ ]
+ }
+});
View
4 src/aria/resources/DateRes_cn_CN.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"星期五",
"星期六"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"一月",
"二月",
View
4 src/aria/resources/DateRes_da_DK.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Fredag",
"L\u00F8rdag"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Januar",
"Februar",
View
4 src/aria/resources/DateRes_de_DE.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Freitag",
"Samstag"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Januar",
"Februar",
View
4 src/aria/resources/DateRes_en_GB.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Friday",
"Saturday"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"January",
"February",
View
4 src/aria/resources/DateRes_en_US.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Friday",
"Saturday"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"January",
"February",
View
4 src/aria/resources/DateRes_es_ES.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Viernes",
"S\u00E1bado"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Enero",
"Febrero",
View
4 src/aria/resources/DateRes_fi_FI.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Perjantai",
"Lauantai"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"tammikuu",
"helmikuu",
View
4 src/aria/resources/DateRes_fr_FR.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Vendredi",
"Samedi"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Janvier",
"F\u00E9vrier",
View
57 src/aria/resources/DateRes_he_IL.js
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT FORMAT
+ * Aria resource object for dates he_IL
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.DateRes',
+ $resources : {
+ day : [
+ "\u05D9\u05D5\u05DD \u05E8\u05D0\u05E9\u05D5\u05DF",
+ "\u05D9\u05D5\u05DD \u05E9\u05E0\u05D9",
+ "\u05D9\u05D5\u05DD \u05E9\u05DC\u05D9\u05E9\u05D9",
+ "\u05D9\u05D5\u05DD \u05E8\u05D1\u05D9\u05E2\u05D9",
+ "\u05D9\u05D5\u05DD \u05D7\u05DE\u05D9\u05E9\u05D9",
+ "\u05D9\u05D5\u05DD \u05E9\u05D9\u05E9\u05D9",
+ "\u05D9\u05D5\u05DD \u05E9\u05D1\u05EA"
+ ],
+ dayShort : [
+ "\u05D0",
+ "\u05D1",
+ "\u05D2",
+ "\u05D3",
+ "\u05D4",
+ "\u05D5",
+ "\u05E9"
+ ],
+ monthShort : false,
+ month : [
+ "\u05D9\u05E0\u05D5\u05D0\u05E8",
+ "\u05E4\u05D1\u05E8\u05D5\u05D0\u05E8",
+ "\u05DE\u05E8\u05E5",
+ "\u05D0\u05E4\u05E8\u05D9\u05DC",
+ "\u05DE\u05D0\u05D9",
+ "\u05D9\u05D5\u05E0\u05D9",
+ "\u05D9\u05D5\u05DC\u05D9",
+ "\u05D0\u05D5\u05D2\u05D5\u05E1\u05D8",
+ "\u05E1\u05E4\u05D8\u05DE\u05D1\u05E8",
+ "\u05D0\u05D5\u05E7\u05D8\u05D5\u05D1\u05E8",
+ "\u05E0\u05D5\u05D1\u05DE\u05D1\u05E8",
+ "\u05D3\u05E6\u05DE\u05D1\u05E8"
+ ]
+ }
+});
View
4 src/aria/resources/DateRes_is_IS.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"f\u00F6studagur",
"laugardagur"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"jan\u00FAar",
"febr\u00FAar",
View
4 src/aria/resources/DateRes_it_IT.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Venerd\u00EC",
"Sabato"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Gennaio",
"Febbraio",
View
4 src/aria/resources/DateRes_ja_JP.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"金曜日",
"土曜日"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"一月",
"二月",
View
4 src/aria/resources/DateRes_ko_KO.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"금요일",
"토요일"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"1월",
"2월",
View
52 src/aria/resources/DateRes_ko_KR.js
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT FORMAT
+ * Aria resource object for dates ko_KR
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.DateRes',
+ $resources : {
+ day : [
+ "일요일",
+ "월요일",
+ "화요일",
+ "수요일",
+ "목요일",
+ "금요일",
+ "토요일"
+ ],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
+ month : [
+ "1월",
+ "2월",
+ "3월",
+ "4월",
+ "5월",
+ "6월",
+ "7월",
+ "8월",
+ "9월",
+ "10월",
+ "11월",
+ "12월"
+ ]
+ }
+});
+
View
4 src/aria/resources/DateRes_nl_NL.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"vrijdag",
"zaterdag"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"januari",
"februari",
View
4 src/aria/resources/DateRes_no_NO.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"fredag",
"l\u00F8rdag"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"januar",
"februar",
View
4 src/aria/resources/DateRes_pl_PL.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Pi\u0105tek",
"Sobota"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Stycze\u0144",
"Luty",
View
4 src/aria/resources/DateRes_pt_BR.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Sexta-feira",
"S\u00E1bado"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Janeiro",
"Fevereiro",
View
4 src/aria/resources/DateRes_pt_PT.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Sexta-feira",
"S\u00E1bado"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Janeiro",
"Fevereiro",
View
4 src/aria/resources/DateRes_ru_RU.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Пятница",
"Суббота"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Январь",
"Февраль",
View
4 src/aria/resources/DateRes_sp_AR.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"الجمعة",
"السبت"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"يناير",
"فبراير",
View
4 src/aria/resources/DateRes_sv_SE.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"fredag",
"l\u00F6rdag"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"januari",
"februari",
View
4 src/aria/resources/DateRes_th_TH.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"วันศุกร์",
"วันเสาร์"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"มกราคม",
"กุมภาพันธ์",
View
4 src/aria/resources/DateRes_tk_TK.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Cuma",
"Cumartesi"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Ocak",
"\u00DEubat",
View
4 src/aria/resources/DateRes_tr_TR.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"Cuma",
"Cumartesi"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"Ocak",
"\u00DEubat",
View
4 src/aria/resources/DateRes_tw_TW.js
@@ -29,6 +29,10 @@ Aria.resourcesDefinition({
"星期五",
"星期六"
],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
month : [
"一月",
"二月",
View
51 src/aria/resources/DateRes_zh_CN.js
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT FORMAT
+ * Aria resource object for dates zh_CN
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.DateRes',
+ $resources : {
+ day : [
+ "星期日",
+ "星期一",
+ "星期二",
+ "星期三",
+ "星期四",
+ "星期五",
+ "星期六"
+ ],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
+ month : [
+ "一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月"
+ ]
+ }
+});
View
51 src/aria/resources/DateRes_zh_TW.js
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DO NOT FORMAT
+ * Aria resource object for dates zh-TW
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.DateRes',
+ $resources : {
+ day : [
+ "星期日",
+ "星期一",
+ "星期二",
+ "星期三",
+ "星期四",
+ "星期五",
+ "星期六"
+ ],
+ // a false value for the following items mean: use substring
+ // to generate the short versions of days or months
+ dayShort : false,
+ monthShort : false,
+ month : [
+ "一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月"
+ ]
+ }
+});
View
26 src/aria/resources/multiselect/FooterRes_ar_SA.js
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for multiselect footer ar_SA (Arabic)
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.multiselect.FooterRes',
+ $resources : {
+ selectAll : "\u062a\u062d\u062f\u064a\u062f\u0020\u0627\u0644\u0643\u0644",
+ deselectAll : "\u0623\u0644\u063a\u064a\u0020\u0623\u062e\u062a\u064a\u0627\u0631\u0020\u0627\u0644\u0643\u0644",
+ close : "\u0623\u063a\u0644\u0627\u0642"
+ }
+});
View
8 src/aria/resources/multiselect/FooterRes_he_IL.js
@@ -14,13 +14,13 @@
*/
/**
- * Aria resource object for multiselect footer he_IL (Hebrew - Israel)
+ * Aria resource object for multiselect footer he_IL (Hebrew)
*/
Aria.resourcesDefinition({
$classpath : 'aria.resources.multiselect.FooterRes',
$resources : {
- selectAll : "\u05d1\u05d7\u05e8\u0020\u05d4\u05db\u05dc",
- deselectAll : "\u05d1\u05d8\u05dc\u0020\u05d1\u05d7\u05d9\u05e8\u05ea\u0020\u05d4\u05db\u05dc",
- close : "\u05e1\u05d2\u05d5\u05e8"
+ selectAll : "\u05D1\u05D7\u05E8 \u05D4\u05DB\u05DC",
+ deselectAll : "\u05D1\u05D9\u05D8\u05D5\u05DC \u05D1\u05D7\u05D9\u05E8\u05D4 \u05D1\u05DB\u05DC",
+ close : "\u05DC\u05E1\u05D2\u05D5\u05E8"
}
});
View
26 src/aria/resources/multiselect/FooterRes_ko_KR.js
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for multiselect footer ko_KR (Korean)
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.multiselect.FooterRes',
+ $resources : {
+ selectAll : "\ubaa8\ub450\u0020\uc120\ud0dd",
+ deselectAll : "\ubaa8\ub450\u0020\uc120\ud0dd\u0020\ucde8\uc18c",
+ close : "\ub2eb\uae30"
+ }
+});
View
26 src/aria/resources/multiselect/FooterRes_zh_CN.js
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for multiselect footer zh_CN (Chinese)
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.multiselect.FooterRes',
+ $resources : {
+ selectAll : "\u5168\u9009",
+ deselectAll : "\u53d6\u6d88\u5168\u9009",
+ close : "\u5173\u95ed"
+ }
+});
View
26 src/aria/resources/multiselect/FooterRes_zh_TW.js
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Aria resource object for multiselect footer zh_TW
+ */
+Aria.resourcesDefinition({
+ $classpath : 'aria.resources.multiselect.FooterRes',
+ $resources : {
+ selectAll : "\u5168\u90e8\u9078\u64c7",
+ deselectAll : "\u5168\u90e8\u53d6\u6d88\u9078\u64c7",
+ close : "\u95dc\u9589"
+ }
+});
View
3  src/aria/templates/Layout.js
@@ -133,6 +133,7 @@
tpl.$refresh();
}
}
+ aria.utils.Dom.refreshScrollbars(ar.domElt);
}
__applyNewSize();
layout.$raiseEvent({
@@ -334,7 +335,7 @@
return __scrollBarsWidth;
}
if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
- return 17; // 17px is the size of scrollbar width on Safari and Chrome on Mac
+ return 17; // 17px is the size of scrollbar width on Safari and Chrome on Mac
} else {
var document = Aria.$window.document;
var o = document.createElement("div"); // outer div
View
14 src/aria/utils/Date.js
@@ -70,6 +70,10 @@ Aria.classDefinition({
case 2 :
return utilString.pad(value.getMonth() + 1, number, "0", true);
case 3 :
+ var monthShort = res.monthShort;
+ if (monthShort) {
+ return monthShort[value.getMonth()];
+ }
return res.month[value.getMonth()].substring(0, number);
default :
return res.month[value.getMonth()];
@@ -99,6 +103,10 @@ Aria.classDefinition({
case 1 :
case 2 :
case 3 :
+ var dayShort = res.dayShort;
+ if (dayShort) {
+ return dayShort[value.getDay()];
+ }
return res.day[value.getDay()].substring(0, number);
default :
return res.day[value.getDay()];
@@ -428,7 +436,7 @@ Aria.classDefinition({
* Given the following extry string, the result in the hh:mm:ss format is
* <pre>
* string format (24h)
- *
+ *
* 1 01:00:00
* 1 10 01:10:00
* 1,20 01:20:00
@@ -772,12 +780,12 @@ Aria.classDefinition({
* Given the following extry string, the result in the format d:MMM:Y is
* <pre>
* string format
- *
+ *
* 1 (first day of current month)
* 1 12 1 Dec (current year)
* 10/3/2012 10 Mar 2012
* 2APR2012 2 Apr 2012
- *
+ *
* +5 (five days from now)
* -2 (two days ago)
* 10JUN2012/+3 13 Jun 2012
View
82 src/aria/utils/Dom.js
@@ -497,23 +497,11 @@ Aria.classDefinition({
_getViewportSize : function () {
var document = Aria.$window.document;
var docEl = document.documentElement;
-
- // In IE8, documentElement's client width/height are always 4px-20px less than they should be (it's not the
- // case in IE7). At the same time, IE8's documentElement's offsetW/H are what clientW/H should be, i.e.
- // viewport dimensions instead of the page dimensions. See:
- // http://www.quirksmode.org/mobile/viewports.html
- // http://www.quirksmode.org/mobile/tableViewport_desktop.html
- if (aria.core.Browser.isIE8) {
- return {
- 'width' : docEl.offsetWidth,
- 'height' : docEl.offsetHeight
- };
- } else {
- return {
- 'width' : docEl.clientWidth,
- 'height' : docEl.clientHeight
- };
- }
+ var size = {
+ 'width' : docEl.clientWidth,
+ 'height' : docEl.clientHeight
+ };
+ return size;
},
/**
@@ -1193,6 +1181,66 @@ Aria.classDefinition({
*/
_setOpacityW3C : function (element, opacity) {
element.style.opacity = opacity;
+ },
+
+ /**
+ * Refreshes scrollbars for the specified DOM element and all its parents.
+ * @see refreshScrollbars
+ * @param {HTMLElement} domElt
+ */
+ _refreshScrollbarsFix : function (domElt) {
+ // work-around for http://crbug.com/240772
+ var values = [];
+ var parent = domElt;
+ while (parent && parent.style) {
+ values.push(parent.style.cssText);
+ parent.style.overflow = "hidden";
+ parent = parent.parentNode;
+ }
+ domElt.getBoundingClientRect(); // making sure Chrome updates the display
+ parent = domElt;
+ while (parent && parent.style) {
+ parent.style.cssText = values.shift();
+ parent = parent.parentNode;
+ }
+ },
+
+ /**
+ * Checks whether <a href="http://crbug.com/240772">this Chrome scrollbars bug</a> (also appearing on other
+ * webkit-based browsers) is still there.
+ * @see refreshScrollbars
+ * @return {Boolean} true if Webkit is used and the bug is still there. false otherwise.
+ */
+ _checkRefreshScrollbarsNeeded : function () {
+ if (!aria.core.Browser.isWebkit) {
+ // we only do this check on Webkit
+ return false;
+ }
+ var document = Aria.$window.document;
+ var testElt = document.createElement("div");
+ testElt.style.cssText = "overflow:auto;width:100px;height:100px;left:-1000px;top:-1000px;";
+ testElt.innerHTML = '<div style="width:150px;height:100px;"></div>';
+ document.body.appendChild(testElt);
+ // firstCheck below is always true, computing it is necessary so that Chrome knows a scrollbar is
+ // needed at this stage
+ var firstCheck = testElt.scrollWidth > testElt.clientWidth;
+ testElt.firstChild.style.width = "100px";
+ var secondCheck = testElt.scrollWidth > testElt.clientWidth; // should be false, but is true on Chrome
+ document.body.removeChild(testElt);
+ return firstCheck && secondCheck;
+ },
+
+ /**
+ * Refreshes scrollbars for the specified DOM element and all its parents. It is needed for some webkit-based
+ * browsers as a work-around for <a href="http://crbug.com/240772">this bug</a>, otherwise scrollbars are not
+ * removed when they are no longer necessary if the content has nearly the same size as the container.<br>
+ * This method does nothing on other browsers. On Webkit, the first time it is called, it checks whether the
+ * work-around is still needed and does nothing if the bug was fixed.
+ * @param {HTMLElement} element
+ */
+ refreshScrollbars : function (domElt) {
+ this.refreshScrollbars = this._checkRefreshScrollbarsNeeded() ? this._refreshScrollbarsFix : Aria.empty;
+ this.refreshScrollbars(domElt);
}
}
});
View
8 src/aria/widgets/CfgBeans.js
@@ -393,6 +393,14 @@ Aria.beanDefinitions({
$type : "common:Callback",
$description : "Function to be called when the user changes the value from this widget"
},
+ "onclick" : {
+ $type : "common:Callback",
+ $description : "Function to be called when the user clicks on the autocomplete."
+ },
+ "onfocus" : {
+ $type : "common:Callback",
+ $description : "Function to be called when the autocomplete receives focus."
+ },
"spellCheck" : {
$type : "json:Boolean",
$description : "Specifies whether native spell check from the browser is enabled or not on this field. If null, uses the default behaviour from the browser. If true or false, tries to enable or disable native spell check from the browser."
View
4 src/aria/widgets/controllers/AutoCompleteController.js
@@ -324,8 +324,8 @@
var suggestionsAvailable = (suggestions !== null);
if (suggestionsAvailable) {
- if (args.keepSelectedValue && dataModel.value) {
- var code = dataModel.value.code;
+ if (args.keepSelectedValue) {
+ var code = dataModel.value ? dataModel.value.code : null;
for (var i = 0; i < suggestions.length; i += 1) {
suggestions[i].exactMatch = (suggestions[i].code === code);
}
View
11 src/aria/widgets/form/TextInput.js
@@ -592,8 +592,8 @@ Aria.classDefinition({
/**
* Compare newValue with the one stored in _cfg[propertyName] Can be overrided to have a specific comparison
* @param {String} propertyName
- * @param {MultiTypes} newValue If transformation is used, this should be the widget value and not the data model
- * value
+ * @param {MultiTypes} newValue If transformation is used, this should be the widget value and not the data
+ * model value
* @private
* @return {Boolean} true if values are considered as equals.
*/
@@ -833,6 +833,9 @@ Aria.classDefinition({
*/
_dom_onclick : function () {
this._autoselect();
+ if (!!this._cfg.onclick) {
+ this.evalCallback(this._cfg.onclick);
+ }
},
/**
@@ -844,6 +847,7 @@ Aria.classDefinition({
*/
_dom_onfocus : function (event) {
this._hasFocus = true;
+
if (!this._keepFocus) {
var cfg = this._cfg;
@@ -879,6 +883,9 @@ Aria.classDefinition({
this.setCaretPosition(caretPosition.start, caretPosition.end);
}
}
+ if (!!this._cfg.onfocus) {
+ this.evalCallback(this._cfg.onfocus);
+ }
},
/**
View
6 test/aria/pageEngine/utils/BaseNavigationManagerTest.js
@@ -77,12 +77,16 @@ Aria.classDefinition({
this._testCacheEntry("", "bbb");
aria.core.Timer.addCallback({
- fn : this._firstTestAfterSecondUpdate,
+ fn : this._firstTestAfterUpdateWithOnlyData,
scope : this,
delay : 100
});
},
+ _firstTestAfterUpdateWithOnlyData : function () {
+ this._firstTestAfterSecondUpdate();
+ },
+
_firstTestAfterSecondUpdate : function () {
if (aria.core.Browser.isIE) {
this._navManager.$dispose();
View
18 test/aria/pageEngine/utils/HistoryManagerTest.js
@@ -24,6 +24,24 @@ Aria.classDefinition({
_getNavManagerInstance : function (cb, options) {
return new this._testWindow.aria.pageEngine.utils.HistoryManager(cb, options);
+ },
+
+ _firstTestAfterUpdateWithOnlyData : function () {
+ this._update({
+ pageId : "bbb",
+ title : "bbb_title",
+ url : "",
+ data : { test : "test"},
+ replace : true
+ });
+
+ this.assertEquals(this._navManager._history.state.test, "test", "History' state has not been updated");
+
+ aria.core.Timer.addCallback({
+ fn : this._firstTestAfterSecondUpdate,
+ scope : this,
+ delay : 100
+ });
}
}
View
28 test/aria/touch/widgets/dialog/events/DialogEventsTestCase.js
@@ -28,7 +28,7 @@ Aria.classDefinition({
$dispose : function () {},
refreshProcessingIndicator : function () {}
};
-
+ this.defaultTestTimeout = 5000;
},
$prototype : {
@@ -74,12 +74,7 @@ Aria.classDefinition({
this.assertJsonEquals(["onBeforeOpen", "onPositioned"], this.eventsFired);
// reset
this.eventsFired = [];
-
- aria.core.Timer.addCallback({
- fn : this.checkEventsArrayAfterOpen,
- scope : this,
- delay : 400
- });
+ this.__waitForEvent(this.checkEventsArrayAfterOpen);
},
checkEventsArrayAfterOpen : function () {
@@ -88,12 +83,7 @@ Aria.classDefinition({
this.popup.close();
this.assertJsonEquals(["onBeforeClose"], this.eventsFired);
this.eventsFired = [];
- aria.core.Timer.addCallback({
- fn : this.checkEventsArrayAfterClose,
- scope : this,
- delay : 400
- });
-
+ this.__waitForEvent(this.checkEventsArrayAfterClose);
},
checkEventsArrayAfterClose : function () {
@@ -102,6 +92,18 @@ Aria.classDefinition({
this.popup.$dispose();
this.eventsFired = null;
this.notifyTestEnd("testAsync_checkEvents");
+ },
+
+ __waitForEvent : function (cb) {
+ this.waitFor({
+ condition : function () {
+ return this.eventsFired.length > 0;
+ },
+ callback : {
+ fn : cb,
+ scope : this
+ }
+ });
}
}
View
20 test/aria/utils/Dom.js
@@ -275,7 +275,6 @@ Aria.classDefinition({
test.scrollLeft = 20;
var target = document.getElementById("block_50");
-
aria.utils.Dom.scrollIntoView(target, false);
// measuring pos is more reliable
@@ -451,6 +450,25 @@ Aria.classDefinition({
left : x,
top : y
});
+ },
+
+ /**
+ * Checks that, after calling refreshScrollbars, the unnecessary scrollbar has disappeared.
+ */
+ testRefreshScrollbars : function () {
+ var document = Aria.$window.document;
+ var testElt = document.createElement("div");
+ testElt.style.cssText = "overflow:auto;width:100px;height:100px;left:-1000px;top:-1000px;";
+ testElt.innerHTML = '<div style="width:150px;height:100px;"></div>';
+ document.body.appendChild(testElt);
+ this.assertTrue(testElt.scrollWidth > testElt.clientWidth); // there must be a scrollbar (normal)
+ aria.utils.Dom.refreshScrollbars(testElt.firstChild); // this makes sure scrollbars are up to date
+ this.assertTrue(testElt.scrollWidth > testElt.clientWidth); // there still must be a scrollbar
+ // Now resizes the content to fit the container:
+ testElt.firstChild.style.width = "100px";
+ aria.utils.Dom.refreshScrollbars(testElt.firstChild); // this makes sure scrollbars are up to date
+ this.assertFalse(testElt.scrollWidth > testElt.clientWidth); // there should not be any scrollbar anymore
+ document.body.removeChild(testElt);
}
}
View
47 test/aria/widgets/container/dialog/viewportResize/ViewportHugeShrinkTemplate.tpl
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2013 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+{Template {
+ $classpath:"test.aria.widgets.container.dialog.viewportResize.ViewportHugeShrinkTemplate"
+}}
+
+ {macro main()}
+ {@aria:Dialog {
+ id : "theDialog",
+ contentMacro: "dialogContent",
+ modal: false,
+ center : false,
+ visible : true,
+ width : 111,
+ height : 111,
+ bind : {
+ xpos : {
+ to : "xpos",
+ inside : data.dialog
+ },
+ ypos : {
+ to : "ypos",
+ inside : data.dialog
+ }
+ }
+ }}
+ {/@aria:Dialog}
+ {/macro}
+
+ {macro dialogContent()}
+ TEST
+ {/macro}
+
+{/Template}
View
119 test/aria/widgets/container/dialog/viewportResize/ViewportHugeShrinkTestCase.js
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2013 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Test case for aria.widgets.container.Dialog
+ */
+Aria.classDefinition({
+ $classpath : "test.aria.widgets.container.dialog.viewportResize.ViewportHugeShrinkTestCase",
+ $extends : "aria.jsunit.TemplateTestCase",
+ $dependencies : ["aria.utils.Dom"],
+ $constructor : function () {
+
+ this.$TemplateTestCase.constructor.call(this);
+
+ this.data = {
+ dialog : {
+ width : 111,
+ height : 111,
+ xpos : 555,
+ ypos : 555
+ },
+ iframeWrapper : {
+ width : 700,
+ height : 700
+ }
+ };
+
+ var frameDim = this.data.iframeWrapper;
+ this.setTestEnv({
+ template : "test.aria.widgets.container.dialog.viewportResize.ViewportHugeShrinkTemplate",
+ data : this.data,
+ css : "overflow:hidden; width:" + frameDim.width + "px; height:" + frameDim.height + "px",
+ iframe : true
+ });
+
+ this.widgetUnderTestId = "theDialog";
+ },
+ $prototype : {
+
+ /*
+ * The aim of this test is to check what happens when the viewport is dramatically shrinked, so that the
+ * Dialog's [x,y] coords before resize were bigger than new viewport's width & height. (e.g. dialog was
+ * positioned at 555x555, and the new window size is much smaller and doesn't contain this reference point).
+ *
+ * The core of the possible issues is that if something goes wrong during the execution of popup handling logic,
+ * the popup, which is temporarily positioned in a remote place at [-15000, -15000], might not be moved back
+ * to the viewport.
+ */
+ runTemplateTest : function () {
+ // in Chrome, overflow:hidden on iframe is not enough, need to set it on <HTML> inside iframe
+ this.testWindow.document.documentElement.style.overflow = "hidden";
+ this._testIsInViewportAfterHugeViewportShrink();
+ },
+
+ _testIsInViewportAfterHugeViewportShrink : function () {
+ this.__resizeIframe(-400, this.__checkVisibility);
+ },
+ __checkVisibility : function () {
+ var geometry = this.__getDialogGeometry();
+
+ // calling AT in an iframe to use iframe's viewport in computations
+ var inViewport = this.testWindow.aria.utils.Dom.isInViewport({
+ top : geometry.y,
+ left : geometry.x
+ }, {
+ width : geometry.width,
+ height : geometry.height
+ });
+
+ this.assertTrue(inViewport, "Dialog is not in the viewport after window resize");
+ this.end();
+ },
+
+ __resizeIframe : function (delta, continueWith) {
+ var initialDimensions = this.data.iframeWrapper;
+ this.testIframe.style.width = (initialDimensions.width + delta) + "px";
+ this.testIframe.style.height = (initialDimensions.height + delta) + "px";
+ this.waitFor({
+ condition : function () {
+ return this.__getDialog(); // wait until the dialog is re-instantiated
+ },
+ callback : {
+ fn : continueWith,
+ scope : this
+ }
+ });
+ },
+
+ /**
+ * @override
+ */
+ notifyTemplateTestEnd : function () {
+ Aria.$window.document.documentElement.style.backgroundColor = "#fff";
+ this.$TemplateTestCase.notifyTemplateTestEnd.call(this);
+ },
+
+ __getDialog : function () {
+ return this.getWidgetInstance(this.widgetUnderTestId);
+ },
+
+ __getDialogGeometry : function () {
+ var container = this.getWidgetInstance(this.widgetUnderTestId);
+ var geometry = aria.utils.Dom.getGeometry(container.getDom());
+ return geometry;
+ }
+ }
+});
View
1  test/aria/widgets/form/autocomplete/AutoCompleteTestSuite.js
@@ -28,6 +28,7 @@ Aria.classDefinition({
this.addTests("test.aria.widgets.form.autocomplete.expandbutton.test1.ExpandButtonCheck");
this.addTests("test.aria.widgets.form.autocomplete.expandbutton.test2.ExpandButtonCheck");
this.addTests("test.aria.widgets.form.autocomplete.expandbutton.test3.ExpandButtonCheck");
+ this.addTests("test.aria.widgets.form.autocomplete.expandbutton.test4.ExpandButtonCheck");
this.addTests("test.aria.widgets.form.autocomplete.handler.test1.LCHandlerTestCase");
this.addTests("test.aria.widgets.form.autocomplete.promised.Promised");
this.addTests("test.aria.widgets.form.autocomplete.onchangeRefresh.OnchangeRefreshTestCase");
View
153 test/aria/widgets/form/autocomplete/expandbutton/test4/ExpandButtonCheck.js
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2013 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Aria.classDefinition({
+ $classpath : "test.aria.widgets.form.autocomplete.expandbutton.test4.ExpandButtonCheck",
+ $extends : "aria.jsunit.TemplateTestCase",
+ $constructor : function () {
+ this.$TemplateTestCase.constructor.call(this);
+ },
+ $destructor : function () {
+ this.$TemplateTestCase.$destructor.call(this);
+ },
+ $prototype : {
+ /**
+ * This method is always the first entry point to a template test Start the test by focusing the first field
+ */
+ runTemplateTest : function () {
+ this.synEvent.click(this.getInputField("ac1"), {
+ fn : this._clickAC,
+ scope : this
+ });
+ },
+
+ _clickAC : function (id, continueWith) {
+ var expandButton = this.getExpandButton("ac1");
+ this.synEvent.click(expandButton, {
+ fn : this._openAC,
+ scope : this
+ });
+ },
+
+ _openAC : function (evt, args) {
+ aria.core.Timer.addCallback({
+ fn : this._selectFirstItem,
+ scope : this,
+ delay : 1000
+ });
+ },
+
+ _selectFirstItem : function () {
+ var ac = this.getInputField("ac1");
+ ac.focus();
+ aria.core.Timer.addCallback({
+ fn : this._afterSelect,
+ scope : this,
+ delay : 1000
+ });
+
+ },
+
+ _afterSelect : function () {
+ this.synEvent.type(this.getInputField("ac1"), "[down][down][enter]", {
+ fn : this._checkSelected,
+ scope : this
+ });
+ },
+
+ _checkSelected : function () {
+ aria.core.Timer.addCallback({
+ fn : this._checkSelectedEntry,
+ scope : this,
+ delay : 1000
+ });
+
+ },
+
+ _checkSelectedEntry : function () {
+ var value = this.getInputField("ac1").value;
+ this.assertTrue(value == "Finnair", "The value of the autocomplete is " + value + ", but it should be Finnair");
+
+ this.synEvent.click(this.getInputField("ac1"), {
+ fn : this._clickAC2,
+ scope : this
+ });
+ },
+
+ _clickAC2 : function (id, continueWith) {
+ var expandButton = this.getExpandButton("ac1");
+ this.synEvent.click(expandButton, {
+ fn : this._openAC2,
+ scope : this
+ });
+ },
+
+ _openAC2 : function (evt, args) {
+ aria.core.Timer.addCallback({
+ fn : this._checkHighlighted,
+ scope : this,
+ delay : 1000
+ });
+ },
+
+ _checkHighlighted : function () {
+ var ac = this.getInputField("ac1");
+ ac.focus();
+ aria.core.Timer.addCallback({
+ fn : this._afterSelect2,
+ scope : this,
+ delay : 1000
+ });
+ },
+
+ _afterSelect2 : function () {
+ var dropdownPopup = this.getWidgetInstance("ac1")._dropdownPopup;
+ var selectedElt = this.getElementsByClassName(dropdownPopup.domElement, "xLISTSelectedItem_dropdown")[0];
+
+ this.assertTrue(selectedElt.innerHTML.match(/<strong>Finnair<\/strong>/gi).length == 1, "The value of the selected element is " + selectedElt.innerHTML + ", but it should be \n<strong>Finnair</strong>\n");
+
+ var expandButton = this.getExpandButton("ac1");
+ this.synEvent.click(expandButton, {
+ fn : this._closeAC,
+ scope : this
+ });
+ },
+
+ _closeAC : function () {
+ this.synEvent.type(this.getInputField("ac1"), "[backspace][backspace][backspace][backspace][backspace][backspace][backspace]", {
+ fn : this._checkText,
+ scope : this
+ });
+ },
+
+ _checkText : function () {
+ var value = this.getInputField("ac1").value;
+ this.assertTrue(value === "", "The value of the autocomplete is " + value + ", but it should be empty");
+ var expandButton = this.getExpandButton("ac1");
+ this.synEvent.click(expandButton, {
+ fn : this._openAC3,
+ scope : this
+ });
+ },
+
+ _openAC3 : function () {
+ var dropdownPopup = this.getWidgetInstance("ac1")._dropdownPopup;
+ var selectedElt = this.getElementsByClassName(dropdownPopup.domElement, "xLISTSelectedItem_dropdown");
+
+ this.assertTrue(selectedElt.length === 0, "There shouldn't be any highlighted element.");
+ this.notifyTemplateTestEnd();
+ }
+ }
+});
View
43 test/aria/widgets/form/autocomplete/expandbutton/test4/ExpandButtonCheckTpl.tpl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013 Amadeus s.a.s.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless req