mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
refactoring
This commit is contained in:
@ -290,3 +290,7 @@ dialog {
|
||||
content: data-uri('../res/img/spinner-light.png');
|
||||
}
|
||||
}
|
||||
|
||||
dialog.dlg-about {
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
@ -8,20 +8,10 @@
|
||||
}};
|
||||
|
||||
Dialog.call(this, params);
|
||||
|
||||
this.pendingBody = null;
|
||||
this.cover = true;
|
||||
}
|
||||
|
||||
AboutDialog.prototype = Object.create(Dialog.prototype);
|
||||
AboutDialog.prototype.constructor = AboutDialog;
|
||||
|
||||
AboutDialog.prototype.setBody = function(html) {
|
||||
this.pendingBody = html;
|
||||
if (this.$body) {
|
||||
this.$body.html(html);
|
||||
}
|
||||
};
|
||||
|
||||
// window.AboutDialog = AboutDialog;
|
||||
// }();
|
||||
@ -72,79 +72,6 @@
|
||||
|
||||
args.id&&(args.id=`id=${args.id}`)||(args.id='');
|
||||
|
||||
// var _html_empty_panel_with_carousel =
|
||||
// `<div id="box-empty-portals" class="empty flex-center offcet-center">
|
||||
// <section class="center-box">
|
||||
// <h3 class="empty-title" l10n style="margin:0 0 60px;">${_lang.portalEmptyTitle}</h3>
|
||||
// <div class='carousel'>
|
||||
// <figure class='carousel__slidebox'>
|
||||
// <div class='carousel__slide'>
|
||||
// <p class='carousel__slide__text title' l10n>${_lang.emptySlide1Title}</p>
|
||||
// <p class='carousel__slide__text descr' l10n>${_lang.emptySlide1Text}</p>
|
||||
// <svg class='carousel__slide__img'>
|
||||
// <use xlink:href='#connect1' data-src='connect1'>
|
||||
// </svg>
|
||||
// </div>
|
||||
// <div class='carousel__slide'>
|
||||
// <p class='carousel__slide__text title' l10n>${_lang.emptySlide2Title}</p>
|
||||
// <p class='carousel__slide__text descr' l10n>${_lang.emptySlide2Text}</p>
|
||||
// <svg class='carousel__slide__img'>
|
||||
// <use xlink:href='#connect2' data-src='connect2'>
|
||||
// </svg>
|
||||
// </div>
|
||||
// <div class='carousel__slide active'>
|
||||
// <p class='carousel__slide__text title' l10n>${_lang.emptySlide3Title}</p>
|
||||
// <p class='carousel__slide__text descr' l10n>${_lang.emptySlide3Text}</p>
|
||||
// <svg class='carousel__slide__img'>
|
||||
// <use xlink:href='#connect3' data-src='connect3'>
|
||||
// </svg>
|
||||
// </div>
|
||||
// </figure>
|
||||
// <nav class='carousel__scrolls'>
|
||||
// <div class='carousel__scroll__btn prev' value='prev'></div>
|
||||
// <div class='carousel__scroll__btn next' value='next'></div>
|
||||
// </nav>
|
||||
// </div>
|
||||
// <div class="tools-connect">
|
||||
// <button class="btn btn--landing newportal" l10n>${_lang.btnCreatePortal}</button>
|
||||
// <section class="link-connect">
|
||||
// <label l10n>${_lang.textHavePortal}</label><a class="login link" l10n href="#">${_lang.btnConnect}</a>
|
||||
// </section>
|
||||
// </div>
|
||||
// </section>
|
||||
// </div>`;
|
||||
|
||||
// var _html_empty_panel_with_providers =
|
||||
// `<div id="box-empty-portals" class="empty flex-center">
|
||||
// <section id='connect-empty-var-2'>
|
||||
// <!--h3 class="empty-title" style="margin:0;" l10n>${_lang.portalEmptyTitle}</h3-->
|
||||
// <h4 class='text-description' l10n='portalEmptyDescr'>${_lang.portalEmptyDescr}</h4>
|
||||
// <section class='tools-connect2 connect'>
|
||||
// <div id='box-providers-premium-button' />
|
||||
// <div id="box-providers-buttons" style='font-size:0;' />
|
||||
// </section>
|
||||
// <h4 class='text-description separate-top' l10n='portalEmptyAdv1'>${_lang.portalEmptyAdv1}</h4>
|
||||
// <div class="tools-connect">
|
||||
// <button class="btn btn--landing newportal" l10n>${_lang.btnCreatePortal}</button>
|
||||
// <section class="link-connect">
|
||||
// <label l10n>${_lang.textHavePortal}</label><a class="login link" href="#" l10n>${_lang.btnConnect}</a>
|
||||
// </section>
|
||||
// </div>
|
||||
// </section>
|
||||
// </div>`;
|
||||
|
||||
// var _html = `<div ${args.id} class="action-panel ${args.action}">
|
||||
// ${config.portals.checklist.length > 1 ? _html_empty_panel_with_providers : _html_empty_panel_with_carousel}
|
||||
// <div id="box-portals">
|
||||
// <div class="flexbox">
|
||||
// <h3 class="table-caption" l10n>${_lang.portalListTitle}</h3>
|
||||
// <div class="table-box flex-fill"><table class="table-files list"></table></div>
|
||||
// <div class="lst-tools">
|
||||
// <button id="btn-addportal" class="btn btn--primary login" l10n>${_lang.btnAddPortal}</button>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>`;
|
||||
|
||||
this.tpl_sidebar =
|
||||
`<div class="sidebar-block-title">
|
||||
@ -158,11 +85,9 @@
|
||||
<div class="table-box flex-fill"><table class="table-files list"></table></div>
|
||||
</div>`;
|
||||
|
||||
// args.tplPage = _html;
|
||||
args.menu = '.main-column.tool-menu';
|
||||
args.field = '.main-column.col-center';
|
||||
args.itemindex = 2;
|
||||
// args.itemtext = _lang.actConnectTo;
|
||||
args.tplItem = 'nomenuitem';
|
||||
|
||||
baseView.prototype.constructor.call(this, args);
|
||||
@ -174,13 +99,10 @@
|
||||
|
||||
utils.fn.extend(ViewPortals.prototype, {
|
||||
render: function() {
|
||||
// baseView.prototype.render.apply(this, arguments);
|
||||
|
||||
const $placeholder = $(this.opts.placeholder);
|
||||
$placeholder.html(this.tpl_sidebar);
|
||||
|
||||
// this.$panelNoPortals = this.$panel.find('#box-empty-portals');
|
||||
// this.$panelPortalList = this.$panel.find('#box-portals');
|
||||
this.$sidebarPortalList = $(this.opts.placeholder);
|
||||
},
|
||||
portaltemplate: function(info, edit) {
|
||||
@ -262,13 +184,7 @@
|
||||
return html_empty_panel;
|
||||
},
|
||||
onscale: function (pasteSvg) {
|
||||
// if ( !pasteSvg ) {
|
||||
// $('button .icon.more',this.$panelPortalList).each(function (){
|
||||
// let elm = $(this);
|
||||
// if( !elm.find('i.icon').length )
|
||||
// elm.append($('<i class="icon tool-icon more" />'));
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -318,8 +234,6 @@
|
||||
};
|
||||
|
||||
function _do_logout(model) {
|
||||
// var model = portalCollection.find('name', info);
|
||||
// model && model.set('logged', false);
|
||||
|
||||
let info = {domain:model.path};
|
||||
const _provider = config.portals.providers.find(model.provider);
|
||||
@ -355,12 +269,7 @@
|
||||
|
||||
window.sdk && window.sdk.checkAuth && window.sdk.checkAuth(auth_arr);
|
||||
|
||||
// this.view.$panelNoPortals.hide();
|
||||
// this.view.$panelPortalList.show();
|
||||
} else {
|
||||
// this.view.$panelNoPortals.show();
|
||||
// this.view.$panelPortalList.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _init_collection = function() {
|
||||
@ -644,35 +553,8 @@
|
||||
else carousel.$items.eq(_pre_index).removeClass('migrate pre-active active pro-active').addClass('pre-active');
|
||||
};
|
||||
|
||||
// function _initCarousel() {
|
||||
// let _$panel = this.view.$panelNoPortals;
|
||||
// carousel.$items = _$panel.find('.carousel__slide');
|
||||
// let _activeindex = carousel.$items.filter('.active').index();
|
||||
|
||||
// if ( !(navigator.userAgent.indexOf("Windows NT 5.") < 0) ||
|
||||
// !(navigator.userAgent.indexOf("Windows NT 6.0") < 0) )
|
||||
// {
|
||||
// $('.carousel', _$panel).addClass('winxp');
|
||||
// }
|
||||
|
||||
// let _pre_index = _activeindex - 1,
|
||||
// _pro_index = _activeindex + 1;
|
||||
|
||||
// if ( _pre_index < 0 ) _pre_index = carousel.$items.length - 1;
|
||||
// if ( _pro_index > carousel.$items.length - 1 ) _pro_index = 0;
|
||||
// carousel.$items.eq(_pre_index).addClass('pre-active');
|
||||
// carousel.$items.eq(_pro_index).addClass('pro-active');
|
||||
|
||||
// _$panel.find('.carousel__scrolls > .carousel__scroll__btn')
|
||||
// .on('click', e => {
|
||||
// _scrollCarousel(e.target.getAttribute('value'));
|
||||
// });
|
||||
|
||||
// _on_theme_changed(localStorage.getItem('ui-theme-id'));
|
||||
// };
|
||||
|
||||
function _on_lang_changed(ol,nl) {
|
||||
// $('.btn-quick.logout',this.$panelPortalList).attr('tooltip',utils.Lang.menuLogout);
|
||||
};
|
||||
|
||||
function _on_theme_changed(name, type) {
|
||||
|
||||
Reference in New Issue
Block a user