diff --git a/src/lib/jar.js b/src/lib/jar.js index 250a04608..b59d16cce 100644 --- a/src/lib/jar.js +++ b/src/lib/jar.js @@ -1,9 +1,9 @@ var cookie = require('cookie'); var xhr = require('xhr'); -var module = module.exports = {}; +var Jar = {}; -module.get = function (name, callback) { +Jar.get = function (name, callback) { // Get cookie by name var obj = cookie.parse(document.cookie) || {}; @@ -16,9 +16,9 @@ module.get = function (name, callback) { return obj[name]; }; -module.use = function (name, uri, callback) { +Jar.use = function (name, uri, callback) { // Attempt to get cookie - module.get(name, function (err, obj) { + Jar.get(name, function (err, obj) { if (typeof obj !== 'undefined') return callback(null, obj); // Make XHR request to cookie setter uri @@ -31,9 +31,11 @@ module.use = function (name, uri, callback) { }); }; -module.set = function (name, value) { +Jar.set = function (name, value) { var obj = cookie.serialize(name, value); var expires = '; expires=' + new Date(new Date().setYear(new Date().getFullYear() + 1)).toUTCString(); var path = '; path=/'; document.cookie = obj + expires + path; }; + +module.exports = Jar; diff --git a/src/lib/render.jsx b/src/lib/render.jsx index ed62ebe41..3e6b36750 100644 --- a/src/lib/render.jsx +++ b/src/lib/render.jsx @@ -2,7 +2,7 @@ var ReactDOM = require('react-dom'); var ReactIntl = require('react-intl'); var IntlProvider = ReactIntl.IntlProvider; -module.exports = function (jsx, element) { +var render = function (jsx, element) { // Get locale and messages from global namespace (see "init.js") var locale = window._locale; var messages = window._translations[locale]; @@ -21,3 +21,5 @@ module.exports = function (jsx, element) { window._renderedComponents.push(component); } }; + +module.exports = render; diff --git a/src/main.jsx b/src/main.jsx index 575115c7f..9d69e6918 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,9 +1,9 @@ -var Render = require('./lib/render.jsx'); +var render = require('./lib/render.jsx'); require('./main.scss'); var Navigation = require('./components/navigation/navigation.jsx'); var Footer = require('./components/footer/footer.jsx'); -Render(, document.getElementById('navigation')); -Render(