Commit 4f5534ed authored by JC Brand's avatar JC Brand

Finally fixed the non-AMD case to work with external templates.

parent c5ae10d9
module.exports = function(grunt) {
var cfg = require('./package.json');
grunt.initConfig({
jst: {
compile: {
options: {
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
},
processName: function (filepath) {
// E.g. src/templates/trimmed_chat.html
return filepath.match(/src\/templates\/([a-z_]+)\.html/)[1];
}
},
files: {
"builds/templates.js": ["src/templates/*.html"]
},
}
},
jshint: {
options: {
trailing: true
......@@ -32,6 +51,7 @@ module.exports = function(grunt) {
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.registerTask('test', 'Run Tests', function () {
......@@ -80,7 +100,8 @@ module.exports = function(grunt) {
};
exec('./node_modules/requirejs/bin/r.js -o src/build.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-otr.js', callback);
'./node_modules/requirejs/bin/r.js -o src/build-no-otr.js &&' +
'./node_modules/requirejs/bin/r.js -o src/build-website.js', callback);
});
grunt.registerTask('minify', 'Create a new release', ['cssmin', 'jsmin']);
......
......@@ -45,10 +45,10 @@ po2json:
########################################################################
## Release management
minjs:
jsmin:
./node_modules/requirejs/bin/r.js -o src/build.js && ./node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js && ./node_modules/requirejs/bin/r.js -o src/build-no-otr.js && ./node_modules/requirejs/bin/r.js -o src/build-website.js
mincss:
cssmin:
grunt cssmin
release:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -22,14 +22,7 @@
}
);
} else {
// Browser globals
// FIXME
_.templateSettings = {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
};
// TODO Templates not defined
root.converse = factory(jQuery, _, OTR, DSA, templates);
root.converse = factory(jQuery, _, OTR, DSA, JST, moment);
}
}(this, function ($, _, OTR, DSA, templates, moment) {
"use strict";
......
......@@ -4,8 +4,8 @@
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Converse.js: Open Source Browser-Based Instant Messaging" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<link rel="stylesheet" type="text/css" media="screen" href="converse.css">
<link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="components/otr/build/dep/salsa20.js"></script>
......@@ -13,8 +13,8 @@
<!-- CryptoJS -->
<script type="text/javascript" src="components/otr/vendor/cryptojs/core.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/enc-base64.js"></script>
<script type="text/javascript" src="components/crypto-js/src/md5.js"></script>
<script type="text/javascript" src="components/crypto-js/src/evpkdf.js"></script>
<script type="text/javascript" src="components/crypto-js-evanvosberg/src/md5.js"></script>
<script type="text/javascript" src="components/crypto-js-evanvosberg/src/evpkdf.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/cipher-core.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/aes.js"></script>
<script type="text/javascript" src="components/otr/vendor/cryptojs/sha1.js"></script>
......@@ -32,16 +32,19 @@
<script type="text/javascript" src="components/strophe.disco/index.js"></script>
<script type="text/javascript" src="components/underscore/underscore.js"></script>
<script type="text/javascript" src="components/backbone//backbone.js"></script>
<script type="text/javascript" src="components/backbone.localStorage/backbone.localStorage.js"></script>
<script type="text/javascript" src="components/backbone.browserStorage/backbone.browserStorage.js"></script>
<script type="text/javascript" src="components/backbone.overview/backbone.overview.js"></script>
<script type="text/javascript" src="components/momentjs/moment.js"></script>
<script type="text/javascript" src="components/jquery.browser/dist/jquery.browser.js"></script>
<script type="text/javascript" src="components/tinysort/src/jquery.tinysort.js"></script>
<script type="text/javascript" src="components/jed/jed.js"></script>
<script type="text/javascript" src="locale/en/LC_MESSAGES/en.js"></script>
<script type="text/javascript" src="builds/templates.js"></script>
<script type="text/javascript" src="converse.js"></script>
<title>Converse.js</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
......@@ -192,7 +195,7 @@
converse.initialize({
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
bosh_service_url: 'http://devbox:8890/http-bind', // Please use this connection manager only for testing purposes
hide_muc_server: false,
i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
prebind: false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment