Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gadicohen/meteor-messageformat
Browse files Browse the repository at this point in the history
Conflicts:
	lib/mfPkg/messageformat-client.js
	package.js
	versions.json
  • Loading branch information
gadicc committed Oct 31, 2014
2 parents cd5147c + ad573d2 commit 0eaa5e9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## vNEXT

## v0.0.46
## v0.0.47

* Bump iron-router to 1.0.0, work with that release, and make it a weak dep

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

MessageFormat support, the Meteor way.

For iron:router < 1.0.0, use messageformat v0.0.45.

For Meteor < 0.8.0, use messageformat v0.0.26.

Easy reactive use of complicated strings (gender, plural, etc) with insanely
Expand Down
20 changes: 11 additions & 9 deletions lib/mfPkg/messageformat-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ mfPkg.mfHelper = function(key, message, params) {
};
UI.registerHelper('mf', mfPkg.mfHelper);

Template.mf.helper = function(component, options) {
var dep = mfPkg.updated();
var key = this.KEY;
if(typeof(UI.toRawText) == "function") //0.8.2 compat
var message = UI.toRawText(component);
else{
var message = Blaze._toText ? Blaze._toText(component, HTML.TEXTMODE.STRING) : Blaze.toText(component, HTML.TEXTMODE.STRING);
Template.mf.helpers({
helper: function(component, options) {
var dep = mfPkg.updated();
var key = this.KEY;
if(typeof(UI.toRawText) == "function") //0.8.2 compat
var message = UI.toRawText(component);
else{
var message = Blaze._toText ? Blaze._toText(component, HTML.TEXTMODE.STRING) : Blaze.toText(component, HTML.TEXTMODE.STRING);
}
return mf(key, this, message, this.LOCALE);
}
return mf(key, this, message, this.LOCALE);
};
});

mfPkg.sendPolicy = 'current';
mfPkg.mfStringsSub = Meteor.subscribe('mfStrings', 'notReady');
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: "gadicohen:messageformat",
version: "0.0.46",
version: "0.0.47",
summary: "MessageFormat support, the Meteor way",
git: "https://github.com/gadicc/meteor-messageformat.git",
});
Expand Down
2 changes: 1 addition & 1 deletion website/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ [email protected]
[email protected]
[email protected]
gadicohen:[email protected]
gadicohen:[email protected].45
gadicohen:[email protected].47
gadicohen:[email protected]_19
[email protected]
[email protected]
Expand Down
7 changes: 5 additions & 2 deletions website/messageformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ if (Meteor.isClient) {
var scrolls = {};

Router.onBeforeAction(function() {
var path = this.route.path();

// remember our scroll position for this page
scrolls[this.path] = $(document).scrollTop();
scrolls[path] = $(document).scrollTop();

var navbar = $('div.navbar:first-child');
navbar.find('.active').removeClass('active');
navbar.find('a[href="' + this.path + '"]').parent().addClass('active');
navbar.find('a[href="' + path + '"]').parent().addClass('active');

this.next();
});

Expand Down

0 comments on commit 0eaa5e9

Please sign in to comment.