Permalink
Browse files

examples/browser: rm build.js, use ../../node-xmpp-browserify.js by p…

…ackage.json
  • Loading branch information...
astro committed Mar 29, 2012
1 parent b9ac126 commit 0e45d7e8b8c1e8316fcbe80f2e65370e5f86bc52
Showing with 5 additions and 23 deletions.
  1. +0 −15 examples/browser/build.js
  2. +3 −7 examples/browser/chat.js
  3. +2 −1 examples/browser/index.html
View
@@ -1,15 +0,0 @@
-var browserify = require('browserify');
-var path = require('path');
-var b = browserify({
- debug: true,
- cache: false
-});
-var root = path.join(__dirname, "..", "..");
-b.require("./lib/node-xmpp-browserify.js",
- { root: root, basedir: root });
-b.include("node-xmpp", "/node_modules/node-xmpp", "module.exports = require('/lib/node-xmpp-browserify.js');");
-b.addEntry('chat.js');
-
-var fs = require('fs');
-
-fs.writeFileSync('index.js', b.bundle());
View
@@ -1,16 +1,12 @@
-try {
-var xmpp = require('node-xmpp');
-} catch (e) {
- console.error(e.stack || e);
-}
-var cl = new xmpp.Client({ websocketsURL: "ws://localhost:5280/",
+var cl = new XMPP.Client({ /*websocketsURL: "ws://localhost:5280/",*/
+ boshURL: "https://beta.buddycloud.org/http-bind/",
jid: 'test@example.com',
password: '***' });
cl.addListener('online',
function() {
["astro@spaceboyz.net"].forEach(
function(to) {
- cl.send(new xmpp.Element('message',
+ cl.send(new XMPP.Element('message',
{ to: to,
type: 'chat'}).
c('body').
@@ -5,5 +5,6 @@
</head>
<body>
-<script src="index.js"></script>
+<script src="../../node-xmpp-browser.js"></script>
+<script src="chat.js"></script>
</body> </html>

0 comments on commit 0e45d7e

Please sign in to comment.