Skip to content

Commit

Permalink
Merge pull request #154 from iLib-js/development
Browse files Browse the repository at this point in the history
Merge to master to create release v14.1.1
  • Loading branch information
ehoogerbeets authored Oct 26, 2018
2 parents f6c40df + b10254c commit 039d8ef
Show file tree
Hide file tree
Showing 77 changed files with 234 additions and 106 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ script:
# [Error] QFontDatabase: Cannot find font directory /usr/lib/x86_64-linux-gnu/fonts - is Qt installed correctly?
- sudo ln -s /usr/share/fonts /usr/lib/x86_64-linux-gnu/fonts

# iLib Full builde / Running nodeunit test.
- ant test
# iLib full build / Run nodeunit tests
- ant clean test
#- which qmake
#- which qmlscene
#- cd qt/NodeunitTest
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

version=14.1.0
version=14.1.1
21 changes: 20 additions & 1 deletion docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Release Notes for Version 14
============================

Build 003
-------
Published as version 14.1.1

Bug Fixes:
* Worked around a problem with uglifyjs which optimized out a block
of code that contained the comment that the ilib-webpack-loader was
looking for. The loader would replace that comment with dependencies on
the webpacked locale data files. Without that comment, no dependencies,
and therefore no locale data and no WebpackLoader code would be
included in the final webpack bundle.
* Added the full file name including the file extension for requires
of `index.js`. If file name extension is missing, QT cannot load that
file properly.
* Added missing `index.js` require statement in MeasurementFactory
* AddressFmt.getFormatInfo would throw an exception for locales where the locale data was not available. Now,
it does not, and instead, it returns some hard-coded info by default that is roughly similar to the en-US
settings.

Build 002
-------
Published as version 14.1.0
Expand All @@ -14,7 +33,7 @@ New Features:
* Allows ilib to run in node or within a webpack bundle without changes
* Allows clients to just require ilib classes directly without first requiring the loader installer

Bug Fixes
Bug Fixes:
* Restored a missing mapping from the the native name for "Japan" to the ISO code "JP" in the nativecountries.json
* Fixes address parsing for Japan

Expand Down
3 changes: 2 additions & 1 deletion js/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ limitations under the License.
<fileset dir="${build.lib}">
<include name="ilib-node*"/>
<include name="ilib-qt*"/>
<include name="ilib-webpack*"/>
<include name="ilib-unpack.js"/>
</fileset>
<fileset dir="${build.base}">
Expand All @@ -359,7 +360,7 @@ limitations under the License.
<arg value="-c"/>
<arg value="-v"/>
<fileset dir="${build.lib}" includes="*.js" excludes="ilib.js,ilib-*.js,runner.js,externs.js,datefmtstr.js"/>
<fileset dir="${build.lib}" includes="ilib-node*.js,ilib-stubs*,ilib-web.js,ilib-qt.js"/>
<fileset dir="${build.lib}" includes="ilib-node*.js,ilib-webpack.js,ilib-stubs*,ilib-web.js,ilib-qt.js"/>
<mapper type="glob" from="*.js" to="*.js"/>
</apply>
<apply osfamily="unix" executable="node" dest="${build.output.dyncode}" parallel="false" force="true">
Expand Down
10 changes: 2 additions & 8 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ var ilib = require("./lib/ilib.js");

if (!ilib._platform || (typeof(ilib._dyndata) !== 'boolean' && typeof(ilib._dyncode) !== 'boolean')) {
if (typeof(__webpack_require__) !== 'undefined') {
// The following will either require and then install the
// WebpackLoader to dynamically load locale data bundles,
// or it will statically require all of the locale data that
// this build needs so that it can be included into this
// webpack bundle.

// !defineLocaleData
require("./lib/ilib-webpack.js");
} else {
switch (ilib._getPlatform()) {
case 'webos':
Expand All @@ -37,7 +31,7 @@ if (!ilib._platform || (typeof(ilib._dyndata) !== 'boolean' && typeof(ilib._dync

case 'qt':
require("./lib/ilib-qt.js");

break;
case 'rhino':
require("./lib/ilib-rhino.js");
break;
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Address.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// !data address countries nativecountries ctrynames

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var JSUtils = require("./JSUtils.js");
var Locale = require("./Locale.js");
Expand Down
50 changes: 46 additions & 4 deletions js/lib/AddressFmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data address addressres regionnames

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var JSUtils = require("./JSUtils.js");

Expand All @@ -28,6 +28,42 @@ var Address = require("./Address.js");
var IString = require("./IString.js");
var ResBundle = require("./ResBundle.js");

// default generic data
var defaultData = {
formats: {
"default": "{streetAddress}\n{locality} {region} {postalCode}\n{country}",
"nocountry": "{streetAddress}\n{locality} {region} {postalCode}"
},
startAt: "end",
fields: [
{
"name": "postalCode",
"line": "startAtLast",
"pattern": "[0-9]+",
"matchGroup": 0
},
{
"name": "region",
"line": "last",
"pattern": "([A-zÀÁÈÉÌÍÑÒÓÙÚÜàáèéìíñòóùúü\\.\\-\\']+\\s*){1,2}$",
"matchGroup": 0
},
{
"name": "locality",
"line": "last",
"pattern": "([A-zÀÁÈÉÌÍÑÒÓÙÚÜàáèéìíñòóùúü\\.\\-\\']+\\s*){1,2}$",
"matchGroup": 0
}
],
fieldNames: {
"streetAddress": "Street Address",
"locality": "City",
"postalCode": "Zip Code",
"region": "State",
"country": "Country"
}
};

/**
* @class
* Create a new formatter object to format physical addresses in a particular way.
Expand Down Expand Up @@ -128,10 +164,16 @@ var AddressFmt = function(options) {
* @private
*/
AddressFmt.prototype._init = function () {
this.style = this.info && this.info.formats && this.info.formats[this.styleName];
if (!this.info) this.info = defaultData;

this.style = this.info.formats && this.info.formats[this.styleName];

// use generic default -- should not happen, but just in case...
this.style = this.style || (this.info && this.info.formats && this.info.formats["default"]) || "{streetAddress}\n{locality} {region} {postalCode}\n{country}";
this.style = this.style || (this.info.formats && this.info.formats["default"]) || defaultData.formats["default"];

if (!this.info.fieldNames) {
this.info.fieldNames = defaultData.fieldNames;
}
};

/**
Expand Down Expand Up @@ -369,7 +411,7 @@ AddressFmt.prototype.getFormatInfo = function(locale, sync, callback) {
sync: this.sync,
loadParams: this.loadParams,
onLoad: ilib.bind(this, function (rb) {
var type, format, fields = this.info.fields;
var type, format, fields = this.info.fields || defaultData.fields;
if (this.info.multiformat) {
type = isAsianLocale(this.locale) ? "asian" : "latin";
fields = this.info.fields[type];
Expand Down
2 changes: 1 addition & 1 deletion js/lib/AlphabeticIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data nfc nfkd

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var Locale = require("./Locale.js");
var CType = require("./CType.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Astro.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* September 1999.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var SearchUtils = require("./SearchUtils.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/CType.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data ctype

var ilib = require("../index");
var ilib = require("../index.js");
var SearchUtils = require("./SearchUtils.js");
var Utils = require("./Utils.js");
var IString = require("./IString.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/CalendarFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var Locale = require("./Locale.js");
var LocaleInfo = require("./LocaleInfo.js");
var Calendar = require("./Calendar.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/CaseMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");

var Locale = require("./Locale.js");
var IString = require("./IString.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Charmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data charmaps charset/US-ASCII charset/ISO-10646-UCS-2 charset/ISO-8859-1 charset/ISO-8859-15 charmaps/ISO-8859-15 charmaps/ISO-8859-1 charset/ISO-8859-1

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");
var IString = require("./IString.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/CharmapFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");

var Charset = require("./Charset.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/CharmapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data charmaps/ISO-8859-15 charset/ISO-8859-15

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var Charset = require("./Charset.js");
var Charmap = require("./Charmap.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Charset.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data charset charsetaliases charset/ISO-8859-1 charset/ISO-8859-15 charset/UTF-8

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");

/**
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data collation

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var JSUtils = require("./JSUtils.js");
var Locale = require("./Locale.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/CopticDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var MathUtils = require("./MathUtils.js");

var Locale = require("./Locale.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Country.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data ctryreverse

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var Locale = require("./Locale.js");
var LocaleInfo = require("./LocaleInfo.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/Currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data currency

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var Locale = require("./Locale.js");
var LocaleInfo = require("./LocaleInfo.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/DateFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");

var Locale = require("./Locale.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/DateFmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data dateformats sysres

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var JSUtils = require("./JSUtils.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/DateRngFmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data dateformats sysres

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");

var Locale = require("./Locale.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/DurationFmt.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// !data dateformats sysres

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");
var Locale = require("./Locale.js");
var LocaleInfo = require("./LocaleInfo.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/EthiopicDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var MathUtils = require("./MathUtils.js");

var EthiopicRataDie = require("./EthiopicRataDie.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/GlyphString.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// !data ccc nfc ctype_m

var ilib = require("../index");
var ilib = require("../index.js");
var Utils = require("./Utils.js");
var JSUtils = require("./JSUtils.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/GregorianDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var SearchUtils = require("./SearchUtils.js");
var MathUtils = require("./MathUtils.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/HanCal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var MathUtils = require("./MathUtils.js");

var Calendar = require("./Calendar.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/HanDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var JSUtils = require("./JSUtils.js");
var MathUtils = require("./MathUtils.js");

Expand Down
2 changes: 1 addition & 1 deletion js/lib/HanRataDie.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var MathUtils = require("./MathUtils.js");
var HanCal = require("./HanCal.js");
var RataDie = require("./RataDie.js");
Expand Down
2 changes: 1 addition & 1 deletion js/lib/HebrewDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

var ilib = require("../index");
var ilib = require("../index.js");
var MathUtils = require("./MathUtils.js");

var Locale = require("./Locale.js");
Expand Down
Loading

0 comments on commit 039d8ef

Please sign in to comment.