Commit df47d167 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 0474e72a
......@@ -45,7 +45,7 @@
"aria2": "^4.1.2",
"candy": "https://github.com/moecube/candy/releases/download/v2.2.0/candy.tar.gz",
"candy-shop": "github:candy-chat/candy-plugins",
"electron": "^14.0.0",
"electron": "^13.3.0",
"electron-builder": "^22.11.7",
"electron-builder-notarize": "^1.2.0",
"exports-loader": "^3.0.0",
......@@ -7079,9 +7079,9 @@
}
},
"node_modules/electron": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-14.0.0.tgz",
"integrity": "sha512-O6EI7L1BPIrTpEIFefjjmdbmSn9LtE4mmrv4dfpV4Mqaa8uKuNYQogwZPEvSwaBexb69eb1LQ25n+f+kBcjiRQ==",
"version": "13.3.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-13.3.0.tgz",
"integrity": "sha512-d/BvOLDjI4i7yf9tqCuLL2fFGA2TrM/D9PyRpua+rJolG0qrwp/FohP02L0m+44kmPpofIo4l3NPwLmzyKKimA==",
"hasInstallScript": true,
"dependencies": {
"@electron/get": "^1.0.1",
......@@ -25129,9 +25129,9 @@
}
},
"electron": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-14.0.0.tgz",
"integrity": "sha512-O6EI7L1BPIrTpEIFefjjmdbmSn9LtE4mmrv4dfpV4Mqaa8uKuNYQogwZPEvSwaBexb69eb1LQ25n+f+kBcjiRQ==",
"version": "13.3.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-13.3.0.tgz",
"integrity": "sha512-d/BvOLDjI4i7yf9tqCuLL2fFGA2TrM/D9PyRpua+rJolG0qrwp/FohP02L0m+44kmPpofIo4l3NPwLmzyKKimA==",
"requires": {
"@electron/get": "^1.0.1",
"@types/node": "^14.6.2",
......@@ -265,3 +265,7 @@ table.expansions tr:last-child td:last-child{
margin-bottom: 0;
margin-top: .5rem;
}
#right .btn-sm {
margin-right: 4px;
}
......@@ -852,6 +852,7 @@ export class AppsService {
}
};
connection.connection.onclose = (event: CloseEvent) => {
console.log(event);
if (id) {
clearInterval(id);
}
......@@ -859,7 +860,7 @@ export class AppsService {
if (this.connections.get(app) === connection) {
this.connections.delete(app);
if (event.code !== 1000 && !connection!.address) {
alert(`出错了 ${event.code}`);
// alert(`出错了 ${event.code}`);
}
}
// 如果还没建立好就出错了,就弹窗提示这个错误
......
app-candy {
@import "node_modules/candy/res/default";
@import "~candy/res/default";
@import "~candy-shop/notifyme/candy";
@import "~candy-shop/namecomplete/candy";
@import "~candy-shop/modify-role/candy";
/* Turn on custom 8px wide scrollbar */
::-webkit-scrollbar {
......
......@@ -2,45 +2,23 @@
* Created by zh99998 on 16/9/2.
*/
// let shadow: ShadowRoot;
//
// const $ = require('../jquery-shadow.js');
// $.fn.init = new Proxy($.fn.init, {
// construct(target, argumentsList, newTarget) {
// let [selector, context, root] = argumentsList;
// if (shadow) {
// if (selector === 'body') {
// selector = shadow;
// } else if (selector === document) {
// selector = $('#candy');
// } else if (!context) {
// context = shadow;
// }
// }
// return new target(selector, context, root);
// }
// });
const $ = require('jquery');
window['jQuery'] = $;
import $ from 'jquery';
import Mustache from 'mustache';
import {
ChangeDetectionStrategy,
Component,
ElementRef,
Inject,
Input,
LOCALE_ID, NgZone,
LOCALE_ID,
NgZone,
OnChanges,
OnInit,
SimpleChanges,
ViewEncapsulation
ViewEncapsulation,
} from '@angular/core';
import { LoginService } from '../login/login.service';
import { SettingsService } from '../settings.service';
import { App } from '../shared/app';
// candy libs
import 'strophe.js';
import 'strophejs-plugin-disco';
......@@ -49,7 +27,6 @@ import 'strophejs-plugin-muc';
import 'strophejs-plugin-caps';
import 'jquery-i18n/jquery.i18n.js';
import './date.format.js';
// candy
import { Candy } from 'candy';
import NotifyMe from 'candy-shop/notifyme/candy.js';
......@@ -60,13 +37,6 @@ import MeDoes from 'candy-shop/me-does/candy.js';
import Notifications from 'candy-shop/notifications/candy.js';
import Refocus from 'candy-shop/refocus/candy.js';
// delete window['jQuery'];
// Candy fix
// declare const Candy: any;
// declare const CandyShop: any;
window['MD5'] = {
hexdigest(s: string) {
return crypto.createHash('sha256').update(s).digest('hex');
......@@ -75,8 +45,14 @@ window['MD5'] = {
// @ts-ignore
Mustache.to_html = function (template, view, partials, send) {
if (partials) {
for (const key of Object.keys(partials)) {
if (view[key]) {
Object.assign(view, view[key]);
}
}
}
const result = Mustache.render(template, view, partials);
if (typeof send === 'function') {
send(result);
} else {
......@@ -314,8 +290,7 @@ export class CandyComponent implements OnInit, OnChanges {
</form>
`;
this.ngZone.runOutsideAngular(()=>{
this.ngZone.runOutsideAngular(() => {
Candy.init('wss://chat.mycard.moe:5443/ws', {
core: {
debug: false,
......@@ -337,7 +312,7 @@ export class CandyComponent implements OnInit, OnChanges {
Refocus.init();
Candy.Core.connect(this.jid, this.password, this.nickname);
})
});
// $(Candy).on('candy:core:roster:loaded', (event: JQueryEventObject, data: any) => {
// this.roster = Object.values(data.roster.getAll());
......@@ -376,10 +351,6 @@ export class CandyComponent implements OnInit, OnChanges {
}
minimize(): void {
// let minimize:HTMLElement = $('#minimize')[0];
// let maximized:HTMLElement = $('#maximized')[0];
// let un_minimize:HTMLElement = $('#un_minimize')[0];
// let un_maximized:HTMLElement = $('#un_maximized')[0];
$('#candy').attr('data-minormax', 'min');
document.getElementById('candy-wrapper')!.style.height = '31px';
$('#mobile-roster-icon').css('display', 'none');
......
......@@ -28,6 +28,9 @@
@import "~bootstrap/scss/bootstrap";
@import "~@fortawesome/fontawesome-free/css/all";
.btn-sm {
line-height: 1.25;
}
html, body {
height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment