Skip to content

Commit

Permalink
build v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Nov 6, 2014
1 parent 8314bb5 commit ee7a73b
Show file tree
Hide file tree
Showing 30 changed files with 487 additions and 433 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ node_modules
*.zip.sig
.buildpath
.classpath
js/ijsxc.config.js
build/js/ijsxc.config.js
config.inc.php
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v1.0.0 / 2014-11-06
===
init with jsxc v1.0.0
17 changes: 14 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(grunt) {
main: {
files: [ {
expand: true,
src: [ 'js/*.js', '!js/sjsxc.config.js', 'js/lib/*.js', 'css/*', 'ajax/*', 'img/*', 'LICENSE' ],
src: [ 'js/*.js', '!js/sjsxc.config.js', 'js/lib/*.js', 'css/*', 'ajax/*', 'img/*', 'classes/*', 'config.inc.php.sample', 'plugin.php', 'LICENSE' ],
dest: 'build/'
}, {
expand: true,
Expand All @@ -42,6 +42,16 @@ module.exports = function(grunt) {
}
}
},
replace: {
version: {
src: [ 'build/plugin.php', 'build/classes/*.php' ],
overwrite: true,
replacements: [ {
from: "$Id$",
to: "<%= app.version %>"
} ]
}
},
search: {
console: {
files: {
Expand Down Expand Up @@ -87,12 +97,13 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-search');
grunt.loadNpmTasks('grunt-contrib-compress');

// Default task.
grunt.registerTask('default', [ 'jshint', 'search', 'clean', 'copy', 'usebanner', 'compress' ]);
grunt.registerTask('default', [ 'jshint', 'search', 'clean', 'copy', 'usebanner', 'replace', 'compress' ]);

grunt.registerTask('pre', [ 'jshint', 'search:console', 'clean', 'copy', 'usebanner', 'compress' ]);
grunt.registerTask('pre', [ 'jshint', 'search:console', 'clean', 'copy', 'usebanner', 'replace', 'compress' ]);
};
9 changes: 9 additions & 0 deletions ajax/getSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
require '../config.inc.php';

$config = $ijsxc_config;

$json = json_encode(array(xmpp => $config['xmpp']));

echo $json;
?>
13 changes: 13 additions & 0 deletions ajax/getTurnCredentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require '../config.inc.php';

$config = $ijsxc_config['ice'];

$data = array ();
$data ['ttl'] = $config['ttl'] ? : 3600 * 24; // one day (according to TURN-REST-API)
$data ['url'] = $config['url'];
$data ['username'] = $config['username'] ? : ($config['secret'] ? (time () + $data ['ttl']) . ':username' : '');
$data ['credential'] = $config['credential'] ? : ($config['secret'] ? base64_encode ( hash_hmac ( 'sha1', $data ['username'], $config['secret'], true ) ) : '');

echo json_encode($data);
?>
10 changes: 0 additions & 10 deletions ajax/getturncredentials.php

This file was deleted.

9 changes: 9 additions & 0 deletions build/ajax/getSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
require '../config.inc.php';

$config = $ijsxc_config;

$json = json_encode(array(xmpp => $config['xmpp']));

echo $json;
?>
13 changes: 13 additions & 0 deletions build/ajax/getTurnCredentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
require '../config.inc.php';

$config = $ijsxc_config['ice'];

$data = array ();
$data ['ttl'] = $config['ttl'] ? : 3600 * 24; // one day (according to TURN-REST-API)
$data ['url'] = $config['url'];
$data ['username'] = $config['username'] ? : ($config['secret'] ? (time () + $data ['ttl']) . ':username' : '');
$data ['credential'] = $config['credential'] ? : ($config['secret'] ? base64_encode ( hash_hmac ( 'sha1', $data ['username'], $config['secret'], true ) ) : '');

echo json_encode($data);
?>
10 changes: 0 additions & 10 deletions build/ajax/getturncredentials.php

This file was deleted.

20 changes: 20 additions & 0 deletions build/classes/class.ilijsxcPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

include_once("./Services/UIComponent/classes/class.ilUserInterfaceHookPlugin.php");

/**
* Example user interface plugin
*
* @author Klaus Herberth <[email protected]>
* @version 1.0.0
*
*/
class ilijsxcPlugin extends ilUserInterfaceHookPlugin
{
function getPluginName()
{
return "ijsxc";
}
}

?>
97 changes: 97 additions & 0 deletions build/classes/class.ilijsxcUIHookGUI.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

include_once("./Services/UIComponent/classes/class.ilUIHookPluginGUI.php");
require_once('./Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/ijsxc/config.inc.php');

/**
* User interface hook class
*
* @author Klaus Herberth <[email protected]>
* @version 1.0.0
* @ingroup ServicesUIComponent
*/
class ilijsxcUIHookGUI extends ilUIHookPluginGUI
{

private $webroot = './Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/ijsxc/';
private $jsFiles = array(
productive => array(
'js/lib/jquery.ui.min.js',
'js/jsxc/lib/jquery.colorbox-min.js',
'js/jsxc/lib/jquery.slimscroll.js',
'js/jsxc/lib/jquery.fullscreen.js',
'js/jsxc/lib/jsxc.dep.min.js',
'js/jsxc/jsxc.min.js',
'js/ijsxc.js'
),
development => array(
'js/lib/jquery.ui.min.js',
'js/jsxc/lib/jquery.colorbox-min.js',
'js/jsxc/lib/jquery.slimscroll.js',
'js/jsxc/lib/jquery.fullscreen.js',
'js/jsxc/lib/strophe.js',
'js/jsxc/lib/strophe.muc.js',
'js/jsxc/lib/strophe.disco.js',
'js/jsxc/lib/strophe.caps.js',
'js/jsxc/lib/strophe.vcard.js',
'js/jsxc/lib/strophe.jingle/strophe.jingle.js',
'js/jsxc/lib/strophe.jingle/strophe.jingle.session.js',
'js/jsxc/lib/strophe.jingle/strophe.jingle.sdp.js',
'js/jsxc/lib/strophe.jingle/strophe.jingle.adapter.js',
'js/jsxc/lib/otr/build/dep/salsa20.js',
'js/jsxc/lib/otr/build/dep/bigint.js',
'js/jsxc/lib/otr/build/dep/crypto.js',
'js/jsxc/lib/otr/build/dep/eventemitter.js',
'js/jsxc/lib/otr/build/otr.js',
'js/jsxc/jsxc.lib.js',
'js/jsxc/jsxc.lib.webrtc.js',
'js/ijsxc.js'
)
);

private $cssFiles = array(
'css/jquery-ui.min.css',
'css/jquery.colorbox.css',
'js/jsxc/jsxc.css',
'js/jsxc/jsxc.webrtc.css',
'css/jsxc.ilias.css'
);

/**
* Modify HTML output of GUI elements. Modifications modes are:
* - ilUIHookPluginGUI::KEEP (No modification)
* - ilUIHookPluginGUI::REPLACE (Replace default HTML with your HTML)
* - ilUIHookPluginGUI::APPEND (Append your HTML to the default HTML)
* - ilUIHookPluginGUI::PREPEND (Prepend your HTML to the default HTML)
*
* @param string $a_comp component
* @param string $a_part string that identifies the part of the UI that is handled
* @param string $a_par array of parameters (depend on $a_comp and $a_part)
*
* @return array array with entries "mode" => modification mode, "html" => your html
*/
function getHTML($a_comp, $a_part, $a_par = array())
{
global $ilCtrl, $ilUser, $ijsxc_config;

$env = ($ijsxc_config['debug'] === true) ? 'development' : 'productive';

if ($a_part == 'template_load' && !$ilCtrl->IsAsynch() && strtolower($a_par['tpl_id']) == 'tpl.main.html') {
$html = '';

foreach ($this->cssFiles as $file) {
$html .= '<link href="'.$this->webroot.$file.'" media="all" rel="stylesheet" type="text/css" />';
}

foreach ($this->jsFiles[$env] as $file) {
$html .= '<script src="'.$this->webroot.$file.'"></script>';
}

return array('mode' => ilUIHookPluginGUI::APPEND, 'html' => $html);
}

return array("mode" => ilUIHookPluginGUI::KEEP, "html" => "");
}

}
?>
38 changes: 38 additions & 0 deletions build/config.inc.php.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
$ijsxc_config = array (
debug => false,
xmpp => array (
/** 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
),
ice => array (
/** Lifetime of credentials. */
ttl => 60*60*12,

/** TURN server url. */
url => 'numb.viagenie.ca',

/** If no username is set, the TURN REST API is used. */
username => '[email protected]',

/** If no credential is set, the TURN REST API is used. */
credential => 'muazkh',

/** Secret for TURN REST API. */
secret => ''
)
);

?>
39 changes: 0 additions & 39 deletions build/js/ijsxc.config.sample.js

This file was deleted.

Loading

0 comments on commit ee7a73b

Please sign in to comment.