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

fix

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