Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >(/usr/lib/GNUstep/SOGo/WebServerResources/sjsxc/js)<-(21:00)# diff -u sjsxc_old.js sjsxc_new.js
- --- sjsxc.js 2017-07-10 20:51:38.482110063 +0200
- +++ sjsxc.orig 2017-07-10 20:51:16.962328998 +0200
- @@ -1,4 +1,17 @@
- -/* jshint undef: false, newcap: false, latedef:nofunc */
- +/*!
- + * sjsxc v3.2.1 - 2017-06-02
- + *
- + * Copyright (c) 2017 Klaus Herberth <klaus@jsxc.org> <br>
- + * Released under the MIT license
- + *
- + * Please see http://jsxc.org/
- + *
- + * @author Klaus Herberth <klaus@jsxc.org>
- + * @version 3.2.1
- + * @license MIT
- + */
- +
- +/* jshint undef: false, newcap: false */
- (function($, pt) {
- @@ -38,50 +51,35 @@
- };
- }
- - function onRosterToggle(event, state) {
- - if ($(window).width() < 768) {
- - // Do not resize elements on extra small devices (bootstrap definition)
- - return;
- + function onRosterToggle(event, state, duration) {
- + var wrapper = $('#rightPanel');
- + var control = $('#toolbar');
- + var roster_width = (state === 'shown') ? $('#jsxc_roster').outerWidth() : 0;
- +
- + wrapper.animate({
- + marginRight: (roster_width) + 'px'
- + }, duration);
- +
- + control.animate({
- + marginRight: (roster_width) + 'px'
- + }, duration, 'swing', function() {
- + if (typeof SOGoResizableTableInterface !== 'undefined') {
- + SOGoResizableTableInterface.resize.call(pt('messageListHeader'));
- }
- -
- - if (state === 'shown') {
- - $('body').addClass('jsxc_rosterVisible');
- - } else {
- - $('body').removeClass('jsxc_rosterVisible');
- - }
- + });
- }
- function onRosterReady() {
- - injectChatIcon();
- - if ($(window).width() < 768) {
- - // Do not resize elements on extra small devices (bootstrap definition)
- - return;
- - }
- -
- - if ($('#jsxc_roster').hasClass('jsxc_state_hidden')) {
- - $('body').removeClass('jsxc_rosterVisible');
- - } else {
- - $('body').addClass('jsxc_rosterVisible');
- - }
- -
- - function injectChatIcon() {
- - var settingsButton = $('md-toolbar a[ng-href$="Mail"]');
- -
- - if (settingsButton.length === 0) {
- - setTimeout(injectChatIcon, 500);
- - return;
- - }
- + var roster_right = parseFloat($('#jsxc_roster').css('right'));
- + var mr = (204 + ($.isNumeric(roster_right) ? roster_right : 0));
- - var a = $('<a>');
- - a.addClass('md-icon-button md-button md-ink-ripple');
- - a.attr('id', 'jsxc_chatIcon');
- - a.click(function(){
- - jsxc.gui.roster.toggle();
- - });
- + $('#toolbar').css('marginRight', mr + 'px');
- + $('#rightPanel').css('marginRight', mr + 'px');
- - settingsButton.after(a);
- - }
- + if (typeof SOGoResizableTableInterface !== 'undefined') {
- + SOGoResizableTableInterface.resize.call(pt('messageListHeader'));
- + }
- }
- function lazyLoadCss(val) {
- @@ -118,6 +116,10 @@
- var sjsxc_start = function() {
- + if ($('#linkBanner').length === 0) {
- + return;
- + }
- +
- $(document).on('ready.roster.jsxc', onRosterReady);
- $(document).on('toggle.roster.jsxc', onRosterToggle);
- $(document).on('connecting.jsxc', function() {
- @@ -146,107 +148,71 @@
- }
- jsxc.init($.extend({
- - app_name: 'SOGo v3',
- + app_name: 'SOGo',
- loginForm: {
- - form: '#login [name="loginForm"]',
- - jid: '#login [ng-model="app.creds.username"]',
- - pass: '#login [ng-model="app.creds.password"]',
- + form: '#connectForm',
- + jid: '#userName',
- + pass: '#password',
- onConnecting: 'quiet',
- - onAuthFail: 'submit',
- - ifFound: 'force'
- + onAuthFail: 'quiet',
- + attachIfFound: false
- },
- - logoutElement: '[href="../logoff"]',
- + logoutElement: $('#logoff'),
- + rosterAppend: 'body',
- root: ResourcesURL + '/sjsxc/js/jsxc',
- RTCPeerConfig: {
- url: '/SOGo.woa/WebServerResources/sjsxc/ajax/getturncredentials.php'
- },
- - loadSettings: function() {
- - return sjsxc.config;
- - },
- - displayRosterMinimized: function() {
- - return true; //$('[ng-href="../logoff"]').length > 0;
- - },
- formFound: function() {
- - $('#login button[type="submit"]:first').attr('id', 'submit');
- - $('#login button[type="submit"]:first').click(function(ev) {
- - var conn = jsxc.xmpp.conn;
- -
- - var submitLoginForm = $(this).data('submitLoginForm');
- - if(submitLoginForm){
- - $(this).data('submitLoginForm', false);
- - }
- + var submit = pt("submit");
- + submit.stopObserving("click", onLoginClick);
- +
- + var userName = pt("userName");
- + userName.stopObserving("keydown", onFieldKeyDown);
- +
- + var passw = pt("password");
- + passw.stopObserving("keydown", onFieldKeyDown);
- - if (!(conn && conn.connected && conn.authenticated) && !submitLoginForm) {
- - ev.stopPropagation();
- - ev.preventDefault();
- + $('#connectForm').submit(function(ev){
- + onLoginClick(ev);
- - // trigger our own connection function
- - $(jsxc.options.loginForm.form).submit();
- + return false;
- + });
- + $('#submit').click(function() {
- + if(!$(this).prop('disabled')) {
- + $('#connectForm').submit();
- + }
- + });
- + $('#userName, #password').keypress(function(ev) {
- + if (ev.which !== 13) {
- + return;
- }
- +
- + $('#connectForm').submit();
- });
- + },
- + loadSettings: function() {
- + return sjsxc.config;
- + },
- + displayRosterMinimized: function() {
- + return $('#logoff').length > 0;
- }
- }, sjsxc.config.jsxc || {}));
- // Add submit link without chat functionality
- - /*if (jsxc.el_exists($('#login'))) {
- + if (jsxc.el_exists($('#loginCell'))) {
- var link = $('<a/>').text($.t('Log_in_without_chat')).click(function() {
- jsxc.submitLoginForm();
- });
- var alt = $('<p id="jsxc_alt"/>').append(link);
- - $('#submit').before(alt);
- - }*/
- - };
- -
- - jsxc.submitLoginForm = function() {
- - var form = $(jsxc.options.loginForm.form).off('submit');
- -
- - // Attach original events
- - var submits = form.data('submits') || [];
- - $.each(submits, function(index, val) {
- - form.submit(val);
- - });
- -
- - if (form.find('#submit').length > 0) {
- - form.find('#submit').data('submitLoginForm', true);
- - form.find('#submit').click();
- - } else if (form.find('[type="submit"]').length > 0) {
- - form.find('[type="submit"]').click();
- - } else if (form.get(0) && typeof form.get(0).submit === 'function') {
- - form.submit();
- - } else {
- - jsxc.warn('Could not submit login form.');
- + $('#loginCell').append('<br/>').append(alt);
- }
- -
- - form.submit(function(ev) {
- - ev.preventDefault();
- -
- - jsxc.prepareLogin(function(settings) {
- - if (settings !== false) {
- - // settings.xmpp.onlogin is deprecated since v2.1.0
- - var enabled = (settings.loginForm && settings.loginForm.enable) || (settings.xmpp && settings.xmpp.onlogin);
- - enabled = enabled === "true" || enabled === true;
- -
- - if (enabled) {
- - jsxc.options.loginForm.triggered = true;
- -
- - jsxc.xmpp.login(jsxc.options.xmpp.jid, jsxc.options.xmpp.password);
- -
- - return;
- - }
- - }
- -
- - jsxc.submitLoginForm();
- - });
- -
- - // Trigger submit in jsxc.xmpp.connected()
- - return false;
- - });
- };
- var sjsxc_init = function() {
- - if ($('#jsxc_sogo_test').css('background-color') !== '' && $('#jsxc_sogo_test').css('position') === 'absolute') {
- + if ($('#jsxc_sogo_test').css('text-align') === 'right') {
- $('#jsxc_sogo_test').remove();
- sjsxc_start();
- } else {
- @@ -263,7 +229,7 @@
- $.extend(true, sjsxc.config, sjsxc.config[document.domain] || {});
- - var el = $('<div>').attr('class', 'jsxc_window').attr('id', 'jsxc_sogo_test');
- + var el = $('<div>').attr('class', 'jsxc_right').attr('id', 'jsxc_sogo_test');
- $('body').append(el);
- var enable = JSON.parse(localStorage.getItem('sjsxc.enable'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement