1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

upgraded Ember and Bootstrap, merged changes

This commit is contained in:
sauls8t 2018-01-22 10:31:03 +00:00
parent b4fd42da38
commit 5dd7d9c181
114 changed files with 9814 additions and 1361 deletions

View file

@ -24,7 +24,8 @@ export default Component.extend({
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -33,7 +34,8 @@ export default Component.extend({
page.set('title', title);
meta.set('rawBody', this.get("data"));
this.attrs.onAction(page, meta);
let cb = this.get('onAction');
cb(page, meta);
}
}
});

View file

@ -9,6 +9,7 @@
//
// https://documize.com
import $ from 'jquery';
import { empty } from '@ember/object/computed';
import { computed } from '@ember/object';
import TooltipMixin from '../../mixins/tooltip';
@ -75,21 +76,25 @@ export default Component.extend(TooltipMixin, ModalMixin, {
return;
}
this.attrs.onAction(this.get('page.title'));
let cb = this.get('onAction');
cb(this.get('page.title'));
},
onCancel() {
if (this.attrs.isDirty() !== null && this.attrs.isDirty()) {
let isDirty = this.get('isDirty');
if (isDirty() !== null && isDirty()) {
this.modalOpen('#discard-modal-' + this.get('page.id'), {show: true});
return;
}
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onDiscard() {
this.modalClose('#discard-modal-' + this.get('page.id'));
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onPreview() {

View file

@ -9,6 +9,7 @@
//
// https://documize.com
import $ from 'jquery';
import { empty } from '@ember/object/computed';
import Component from '@ember/component';
import ModalMixin from '../../mixins/modal';
@ -44,17 +45,21 @@ export default Component.extend(ModalMixin, {
actions: {
onCancel() {
if (this.attrs.isDirty() !== null && this.attrs.isDirty()) {
let isDirty = this.get('isDirty');
if (isDirty() !== null && isDirty()) {
this.modalOpen('#discard-modal', {show: true});
return;
}
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onDiscard() {
this.modalClose('#discard-modal');
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction() {
@ -72,7 +77,8 @@ export default Component.extend(ModalMixin, {
return;
}
this.attrs.onAction(this.get('page.title'));
let cb = this.get('onAction');
cb(this.get('page.title'));
}
}
});

View file

@ -16,7 +16,7 @@ import TooltipMixin from '../../../mixins/tooltip';
export default Component.extend(TooltipMixin, {
isDirty: false,
pageBody: "",
syntaxOptions: [],
codeSyntax: null,
codeEditor: null,
editorId: computed('page', function () {
@ -29,7 +29,8 @@ export default Component.extend(TooltipMixin, {
}),
init() {
this._super(...arguments);
this._super(...arguments);
this.syntaxOptions = [];
let self = this;
let rawBody = this.get('meta.rawBody');
@ -128,7 +129,8 @@ export default Component.extend(TooltipMixin, {
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -138,7 +140,8 @@ export default Component.extend(TooltipMixin, {
page.set('title', title);
page.set('body', meta.get('rawBody'));
this.attrs.onAction(page, meta);
let cb = this.get('onAction');
cb(page, meta);
}
}
});

View file

@ -9,6 +9,7 @@
//
// https://documize.com
import $ from 'jquery';
import { set } from '@ember/object';
import { schedule } from '@ember/runloop';
import { inject as service } from '@ember/service';
@ -21,9 +22,13 @@ export default Component.extend(SectionMixin, TooltipMixin, {
isDirty: false,
waiting: false,
authenticated: false,
user: {},
workspaces: [],
config: {},
init() {
this._super(...arguments);
this.user = {};
this.workspaces = [];
this.config = {};
},
didReceiveAttrs() {
let config = {};
@ -195,7 +200,8 @@ export default Component.extend(SectionMixin, TooltipMixin, {
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -206,7 +212,8 @@ export default Component.extend(SectionMixin, TooltipMixin, {
meta.set('config', JSON.stringify(this.get('config')));
meta.set('externalSource', true);
this.attrs.onAction(page, meta);
let cb = this.get('onAction');
cb(page, meta);
}
}
});

View file

@ -9,6 +9,7 @@
//
// https://documize.com
import $ from 'jquery';
import EmberObject from '@ember/object';
import { A } from '@ember/array';
import { inject as service } from '@ember/service';
@ -21,9 +22,13 @@ export default Component.extend(SectionMixin, NotifierMixin, {
isDirty: false,
busy: false,
authenticated: false,
config: {},
owners: null,
init() {
this._super(...arguments);
this.config = {};
},
didReceiveAttrs() {
let self = this;
let page = this.get('page');
@ -227,7 +232,8 @@ export default Component.extend(SectionMixin, NotifierMixin, {
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {

View file

@ -111,7 +111,8 @@ export default Component.extend({
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -120,7 +121,8 @@ export default Component.extend({
page.set('title', title);
meta.set('rawBody', this.getBody());
this.attrs.onAction(page, meta);
let cb = this.get('onCancel');
cb(page, meta);
}
}
});

View file

@ -21,8 +21,12 @@ export default Component.extend(SectionMixin, NotifierMixin, {
isDirty: false,
waiting: false,
authenticated: false,
config: {},
items: {},
init() {
this._super(...arguments);
this.config = {};
this.items = {};
},
didReceiveAttrs() {
let config = {};
@ -140,7 +144,8 @@ export default Component.extend(SectionMixin, NotifierMixin, {
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {

View file

@ -9,8 +9,9 @@
//
// https://documize.com
import $ from 'jquery';
import { schedule } from 'ember/runloop';
import { computed } from '@ember/object';
import Component from '@ember/component';
export default Component.extend({
@ -38,8 +39,10 @@ export default Component.extend({
tableResizerOffset: 10
});
$(id).on('froalaEditor.contentChanged', () => {
this.set('isDirty', true);
schedule('afterRender', function() {
$(id).on('froalaEditor.contentChanged', () => {
this.set('isDirty', true); // eslint-disable-line ember/jquery-ember-run
});
});
},
@ -53,7 +56,8 @@ export default Component.extend({
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -69,7 +73,8 @@ export default Component.extend({
meta.set('rawBody', body);
this.attrs.onAction(page, meta);
let cb = this.get('onAction');
cb(page, meta);
}
}
});

View file

@ -11,7 +11,6 @@
/*global Trello*/
import $ from 'jquery';
import { htmlSafe } from '@ember/string';
import { computed, set } from '@ember/object';
import { inject as service } from '@ember/service';
@ -25,11 +24,9 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
isDirty: false,
busy: false,
authenticated: false,
config: {},
boards: null,
noBoards: false,
appKey: "",
boardStyle: computed('config.board', function () {
let board = this.get('config.board');
@ -41,6 +38,11 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
return htmlSafe("background-color: " + color);
}),
init() {
this._super(...arguments);
this.config = {};
},
didReceiveAttrs() {
let page = this.get('page');
let config = {};
@ -219,7 +221,8 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {

View file

@ -9,8 +9,8 @@
//
// https://documize.com
import $ from 'jquery';
import { computed, set } from '@ember/object';
import Component from '@ember/component';
import { inject as service } from '@ember/service';
@ -116,7 +116,8 @@ export default Component.extend({
},
onCancel() {
this.attrs.onCancel();
let cb = this.get('onCancel');
cb();
},
onAction(title) {
@ -127,7 +128,8 @@ export default Component.extend({
page.set('title', title);
meta.set('rawBody', editor.getContent());
this.attrs.onAction(page, meta);
let cb = this.get('onAction');
cb(page, meta);
}
}
});