Skip to content

Commit 0eaa5e9

Browse files
committed
Merge branch 'master' of github.com:gadicohen/meteor-messageformat
Conflicts: lib/mfPkg/messageformat-client.js package.js versions.json
2 parents cd5147c + ad573d2 commit 0eaa5e9

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

History.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## vNEXT
22

3-
## v0.0.46
3+
## v0.0.47
44

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

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
MessageFormat support, the Meteor way.
44

5+
For iron:router < 1.0.0, use messageformat v0.0.45.
6+
57
For Meteor < 0.8.0, use messageformat v0.0.26.
68

79
Easy reactive use of complicated strings (gender, plural, etc) with insanely

lib/mfPkg/messageformat-client.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ mfPkg.mfHelper = function(key, message, params) {
1818
};
1919
UI.registerHelper('mf', mfPkg.mfHelper);
2020

21-
Template.mf.helper = function(component, options) {
22-
var dep = mfPkg.updated();
23-
var key = this.KEY;
24-
if(typeof(UI.toRawText) == "function") //0.8.2 compat
25-
var message = UI.toRawText(component);
26-
else{
27-
var message = Blaze._toText ? Blaze._toText(component, HTML.TEXTMODE.STRING) : Blaze.toText(component, HTML.TEXTMODE.STRING);
21+
Template.mf.helpers({
22+
helper: function(component, options) {
23+
var dep = mfPkg.updated();
24+
var key = this.KEY;
25+
if(typeof(UI.toRawText) == "function") //0.8.2 compat
26+
var message = UI.toRawText(component);
27+
else{
28+
var message = Blaze._toText ? Blaze._toText(component, HTML.TEXTMODE.STRING) : Blaze.toText(component, HTML.TEXTMODE.STRING);
29+
}
30+
return mf(key, this, message, this.LOCALE);
2831
}
29-
return mf(key, this, message, this.LOCALE);
30-
};
32+
});
3133

3234
mfPkg.sendPolicy = 'current';
3335
mfPkg.mfStringsSub = Meteor.subscribe('mfStrings', 'notReady');

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: "gadicohen:messageformat",
3-
version: "0.0.46",
3+
version: "0.0.47",
44
summary: "MessageFormat support, the Meteor way",
55
git: "https://github.com/gadicc/meteor-messageformat.git",
66
});

website/.meteor/versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ facebook@1.1.2
2525
fastclick@1.0.1
2626
follower-livedata@1.0.2
2727
gadicohen:headers@0.0.25
28-
gadicohen:messageformat@0.0.45
28+
gadicohen:messageformat@0.0.47
2929
gadicohen:syntaxhighlighter@3.0.83_19
3030
geojson-utils@1.0.1
3131
github@1.1.1

website/messageformat.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ if (Meteor.isClient) {
2020
var scrolls = {};
2121

2222
Router.onBeforeAction(function() {
23+
var path = this.route.path();
24+
2325
// remember our scroll position for this page
24-
scrolls[this.path] = $(document).scrollTop();
26+
scrolls[path] = $(document).scrollTop();
2527

2628
var navbar = $('div.navbar:first-child');
2729
navbar.find('.active').removeClass('active');
28-
navbar.find('a[href="' + this.path + '"]').parent().addClass('active');
30+
navbar.find('a[href="' + path + '"]').parent().addClass('active');
31+
2932
this.next();
3033
});
3134

0 commit comments

Comments
 (0)