Skip to content

Commit

Permalink
outsource config
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Aug 20, 2014
1 parent b30bbd0 commit cec3848
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
js/sjsxc.config.js
*.zip
26 changes: 26 additions & 0 deletions js/sjsxc.config.sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Rename/copy this file to sjsxc.config.js and adjust the settings.
*/

var sjsxc = {};
sjsxc.config = {
/** enable chat by default? */
enable: true,
xmpp: {
/** url to bosh server binding. */
url: '/http-bind/',

/** domain part of your jid */
domain: 'localhost',

/** which resource should be used? Blank, means random. */
resource: '',

/** Allow user to overwrite xmpp settings? */
overwrite: true,

/** Should chat start on login? */
onlogin: true
}
};

18 changes: 6 additions & 12 deletions js/sjsxc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
/* global jsxc, $, configureLinksInMessage:true, SOGoResizableTableInterface, ResourcesURL, onLoginClick, onFieldKeyDown */

var sjsxc = {};
sjsxc.config = {
enable: true,
xmpp: {
url: '/http-bind/', // or e.g. 'http://localhost:5280/http-bind/'
domain: 'localhost',
resource: '',
overwrite: true,
onlogin: true
}
};

(function($, pt) {

if (typeof configureLinksInMessage === "function") {
Expand Down Expand Up @@ -181,6 +169,12 @@ sjsxc.config = {
};

$(function(){

if (typeof sjsxc === 'undefined' || typeof sjsxc.config === 'undefined') {
console.error('No config for sjsxc found! Look at sjsxc.config.sample.js.');
return;
}

var el = $('<div>').attr('class', 'jsxc_window').attr('id', 'jsxc_sogo_test');
$('body').append(el);

Expand Down

0 comments on commit cec3848

Please sign in to comment.