diff --git a/dist/recline.css b/dist/recline.css index 5d7f6e86..f1e976fd 100644 --- a/dist/recline.css +++ b/dist/recline.css @@ -219,6 +219,32 @@ div.data-table-cell-content-numeric > a.data-table-cell-edit { .recline-read-only a.row-header-menu { display: none; } + +/************************* + * WCAG 2.0 + *************************/ + +.wcag_hide { + position:absolute; + top:0; + left:-10000px; + width:1px; + height:1px; +} + +.wcag_hide2 { + clip: rect(1px, 1px, 1px, 1px); + display: block; + position: absolute; +} + +.wcag_show_on_focus { + font-size: 0 !important; +} + +.wcag_show_on_focus:focus { + font-size: 1em !important; +} .recline-map .map { height: 500px; } diff --git a/make b/make index 1a949d79..ea2404ed 100755 --- a/make +++ b/make @@ -5,7 +5,9 @@ import os def cat(): print("** Combining js files") - cmd = '{ ls src/**/*.js & ls src/*.js; } | grep -v couchdb | xargs cat > dist/recline.js' + cmd = 'ls src/**/*.js | grep -v couchdb | xargs cat > dist/recline.js' + os.system(cmd) + cmd = 'ls src/*.js | grep -v couchdb | xargs cat >> dist/recline.js' os.system(cmd) cmd = 'cat src/model.js src/backend.memory.js > dist/recline.dataset.js' diff --git a/src/i18n/en.js b/src/i18n/en.js index 6bd5cf9b..f7c26b88 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -11,4 +11,4 @@ this.recline.View.translations['en'] = { map_mapping: 'Coordinates source', map_mapping_lat_lon: 'Latitude / Longitude fields', map_mapping_geojson: 'GeoJSON field' -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/i18n/pl.js b/src/i18n/pl.js index 82cccb3e..a00e8d2d 100644 --- a/src/i18n/pl.js +++ b/src/i18n/pl.js @@ -63,4 +63,4 @@ this.recline.View.translations['pl'] = { Cluster_markers: 'Łącz pobliskie punkty w grupy', num_records: '{recordCount} rekordów' -} +}; \ No newline at end of file diff --git a/src/i18n/view.i18n.js b/src/i18n/view.i18n.js index 67962b30..dd065c50 100644 --- a/src/i18n/view.i18n.js +++ b/src/i18n/view.i18n.js @@ -13,12 +13,11 @@ Backbone.I18nView = Backbone.View.extend({ this.cache[this.locale] = {}; }, - formatMessage(key, values) { - this.cachedMsg.format(key, values); - }, - // TODO how to use it from outside? an singleton instance of I18n? use case: pass translated strings into view initializer - t: function(key, values = {}, defaultMessage = null) { + t: function(key) { + this.t(key, {}, null); + }, + t: function(key, values, defaultMessage) { // get the message from current locale var msg = recline.View.translations[this.locale][key]; @@ -38,8 +37,6 @@ Backbone.I18nView = Backbone.View.extend({ } - // TODO i18n documentation - try { var formatter = this.cache[this.locale][msg]; if (formatter === undefined) { @@ -61,7 +58,7 @@ Backbone.I18nView = Backbone.View.extend({ MustacheFormatter: function() { var formatter = new Proxy(this, { - get(view, name) { + get: function(view, name) { return function() { var f = function (text, render) { var trans = view.t(name, this, text); @@ -73,7 +70,7 @@ Backbone.I18nView = Backbone.View.extend({ return f; }; }, - has(target, prop) { + has: function(target, prop) { return true; } }); diff --git a/src/view.slickgrid.js b/src/view.slickgrid.js index 24997dda..e10a8d78 100644 --- a/src/view.slickgrid.js +++ b/src/view.slickgrid.js @@ -448,10 +448,11 @@ my.GridControl= Backbone.I18nView.extend({ // Template for row edit menu , change it if you don't love template: '
', - initialize: function(options = {}){ + initialize: function(options){ var self = this; _.bindAll(this, 'render'); this.state = new recline.Model.ObjectState(); + options = options || {}; this.initializeI18n(options.locale); this.render(); diff --git a/src/widget.queryeditor.js b/src/widget.queryeditor.js index 3753ab6e..be2620d6 100644 --- a/src/widget.queryeditor.js +++ b/src/widget.queryeditor.js @@ -27,9 +27,10 @@ my.QueryEditor = Backbone.I18nView.extend({ 'submit form': 'onFormSubmit' }, - initialize: function(options = {}) { + initialize: function(options) { _.bindAll(this, 'render'); this.listenTo(this.model, 'change', this.render); + options = options || {}; this.initializeI18n(options.locale); this.render(); diff --git a/src/widget.valuefilter.js b/src/widget.valuefilter.js index 60cdd9b8..97babc6f 100644 --- a/src/widget.valuefilter.js +++ b/src/widget.valuefilter.js @@ -50,10 +50,12 @@ my.ValueFilter = Backbone.I18nView.extend({ 'submit form.js-edit': 'onTermFiltersUpdate', 'submit form.js-add': 'onAddFilter' }, - initialize: function(options = {}) { + initialize: function(options) { _.bindAll(this, 'render'); this.listenTo(this.model.fields, 'all', this.render); this.listenTo(this.model.queryState, 'change change:filters:new-blank', this.render); + + options = options || {}; this.initializeI18n(options.locale); this.render();