mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[start page] refactoring. locked unused code
This commit is contained in:
@ -100,7 +100,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
dialogconnect: {
|
||||
files: {
|
||||
'../src/dlglogin.min.js' : ['../src/dlglogin.js','../src/dialogconnect.js']
|
||||
'../src/dialogconnect.min.js' : ['../src/dialogconnect.js']
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
,"../src/panelwelcome.js"
|
||||
,"../src/panelsettings.js"
|
||||
,"../src/panelexternal.js"
|
||||
,"../src/dlglogin.min.js"
|
||||
,"../src/dialogconnect.min.js"
|
||||
,"../src/panels.js"
|
||||
],
|
||||
"dest": "../deploy/build.js"
|
||||
|
||||
@ -228,7 +228,8 @@
|
||||
<script type="text/javascript" src="paneltemplates.js"></script>
|
||||
<script src="panelsettings.js"></script>
|
||||
<script src="panelexternal.js"></script>
|
||||
<script type="text/javascript" src="dlglogin.js"></script>
|
||||
<!-- TODO: remove after ver 8.0. login proc via portal's api isn't used any more -->
|
||||
<!-- <script type="text/javascript" src="dlglogin.js"></script> -->
|
||||
<script src="dialogconnect.js"></script>
|
||||
<script type="text/javascript" src="panels.js"></script>
|
||||
|
||||
|
||||
@ -223,7 +223,7 @@
|
||||
utils.fn.extend(ControllerPortals.prototype, (function() {
|
||||
let collection,
|
||||
ppmenu;
|
||||
let dlgLogin;
|
||||
// let dlgLogin;
|
||||
|
||||
function _on_context_menu(menu, action, data) {
|
||||
var model = data;
|
||||
@ -265,7 +265,8 @@
|
||||
_dialog.show();
|
||||
};
|
||||
|
||||
function _do_login(model) {
|
||||
// TODO: remove after ver 8.0. login proc via portal's api isn't used any more
|
||||
/* function _do_login(model) {
|
||||
if ( !dlgLogin ) {
|
||||
!model && (model = {})
|
||||
dlgLogin = new LoginDlg({
|
||||
@ -293,30 +294,32 @@
|
||||
|
||||
dlgLogin.show({portal: model.path, provider: model.provider, email: model.email});
|
||||
}
|
||||
};
|
||||
}; */
|
||||
|
||||
if ( config.portals && !!config.portals.auth_use_api ) {
|
||||
_do_connect = _do_login;
|
||||
}
|
||||
// TODO: remove after ver 8.0. login proc via portal's api isn't used any more
|
||||
// if ( config.portals && !!config.portals.auth_use_api ) {
|
||||
// _do_connect = _do_login;
|
||||
// }
|
||||
|
||||
function _authorize(portal, user, data) {
|
||||
if ( !dlgLogin ) {
|
||||
dlgLogin = new LoginDlg({
|
||||
success: info => {
|
||||
// dlgLogin.close();
|
||||
PortalsStore.keep(info.data);
|
||||
_update_portals.call(this);
|
||||
// TODO: remove after ver 8.0. login proc via portal's api isn't used any more
|
||||
// function _authorize(portal, user, data) {
|
||||
// if ( !dlgLogin ) {
|
||||
// dlgLogin = new LoginDlg({
|
||||
// success: info => {
|
||||
// // dlgLogin.close();
|
||||
// PortalsStore.keep(info.data);
|
||||
// _update_portals.call(this);
|
||||
|
||||
CommonEvents.fire('portal:authorized', [data]);
|
||||
},
|
||||
close: code => {
|
||||
dlgLogin = undefined;
|
||||
}
|
||||
});
|
||||
// CommonEvents.fire('portal:authorized', [data]);
|
||||
// },
|
||||
// close: code => {
|
||||
// dlgLogin = undefined;
|
||||
// }
|
||||
// });
|
||||
|
||||
dlgLogin.show({portal: portal, email: user});
|
||||
}
|
||||
};
|
||||
// dlgLogin.show({portal: portal, email: user});
|
||||
// }
|
||||
// };
|
||||
|
||||
function _do_logout(model) {
|
||||
// var model = portalCollection.find('name', info);
|
||||
@ -478,7 +481,7 @@
|
||||
};
|
||||
|
||||
var _on_create_portal = function() {
|
||||
dlgLogin && dlgLogin.close();
|
||||
// dlgLogin && dlgLogin.close();
|
||||
window.sdk.execCommand('portal:create', '');
|
||||
};
|
||||
|
||||
@ -571,9 +574,9 @@
|
||||
opts = JSON.parse(params);
|
||||
} catch (e) { /*delete opts;*/ }
|
||||
|
||||
if ( opts && opts.portals && opts.portals.auth_use_api ) {
|
||||
_do_connect = _do_login;
|
||||
}
|
||||
// if ( opts && opts.portals && opts.portals.auth_use_api ) {
|
||||
// _do_connect = _do_login;
|
||||
// }
|
||||
} else
|
||||
if (params.includes('\"uitheme\"\:')) {
|
||||
// let opts = JSON.parse(params);
|
||||
@ -718,18 +721,19 @@
|
||||
var model = collection.find('name', utils.skipUrlProtocol(portal));
|
||||
return model && model.logged;
|
||||
},
|
||||
authorizeOn: function(portal, data) {
|
||||
var model = collection.find('name', utils.skipUrlProtocol(portal));
|
||||
if ( !model ) {
|
||||
_authorize.call(this, portal, undefined, data);
|
||||
} else
|
||||
if ( !model.logged ) {
|
||||
_authorize.call(this, portal, model.email, data);
|
||||
}
|
||||
}
|
||||
, collection: function() {
|
||||
// TODO: remove after ver 8.0. login proc via portal's api isn't used any more
|
||||
// authorizeOn: function(portal, data) {
|
||||
// var model = collection.find('name', utils.skipUrlProtocol(portal));
|
||||
// if ( !model ) {
|
||||
// _authorize.call(this, portal, undefined, data);
|
||||
// } else
|
||||
// if ( !model.logged ) {
|
||||
// _authorize.call(this, portal, model.email, data);
|
||||
// }
|
||||
// },
|
||||
collection: function() {
|
||||
return collection;
|
||||
}
|
||||
},
|
||||
};
|
||||
})());
|
||||
}();
|
||||
|
||||
@ -68,11 +68,6 @@ $(document).ready(function() {
|
||||
CommonEvents.fire("portal:create");
|
||||
});
|
||||
|
||||
if (!window.LoginDlg) {
|
||||
$('.tools-connect').hide();
|
||||
hideAction('connect');
|
||||
}
|
||||
|
||||
if (!window.config.portals.checklist) {
|
||||
$('.tools-connect').hide();
|
||||
hideAction('connect');
|
||||
|
||||
Reference in New Issue
Block a user