mirror of
https://github.com/documize/community.git
synced 2025-07-21 14:19:43 +02:00
fixes
This commit is contained in:
parent
0d9400965d
commit
9f7585e2a5
18 changed files with 126 additions and 103 deletions
|
@ -38,12 +38,12 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
didRender() {
|
didRender() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
this.contentLinkHandler();
|
let jumpTo = this.get('pageId');
|
||||||
|
if (is.not.empty(jumpTo) && is.not.undefined(jumpTo) && !$("#page-" + jumpTo).inView()) {
|
||||||
|
$("#page-" + jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
||||||
|
}
|
||||||
|
|
||||||
let self = this;
|
this.contentLinkHandler();
|
||||||
$(".tooltipped").each(function(i, el) {
|
|
||||||
self.addTooltip(el);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -57,15 +57,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||||
} });
|
} });
|
||||||
|
|
||||||
let jumpTo = this.get('pageId');
|
let self = this;
|
||||||
if (is.not.empty(jumpTo)) {
|
$(".tooltipped").each(function(i, el) {
|
||||||
let self = this;
|
self.addTooltip(el);
|
||||||
$("#page-" + jumpTo).velocity("scroll", { duration: 250, offset: -100, complete:
|
});
|
||||||
function() {
|
|
||||||
self.set('pageId', '');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
willDestroyElement() {
|
willDestroyElement() {
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
document: {},
|
document: {},
|
||||||
folder: {},
|
folder: {},
|
||||||
pages: [],
|
pages: [],
|
||||||
page: "",
|
currentPageId: "",
|
||||||
state: {
|
state: {
|
||||||
actionablePage: false,
|
actionablePage: false,
|
||||||
upDisabled: true,
|
upDisabled: true,
|
||||||
|
@ -35,8 +35,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 0);
|
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 0);
|
||||||
|
|
||||||
if (is.not.null(this.get('page'))) {
|
if (is.not.null(this.get('currentPageId'))) {
|
||||||
this.send('onEntryClick', this.get('page'));
|
this.send('onEntryClick', this.get('currentPageId'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
// Controls what user can do with the toc (left sidebar).
|
// Controls what user can do with the toc (left sidebar).
|
||||||
// Identifies the target pages.
|
// Identifies the target pages.
|
||||||
setState(pageId) {
|
setState(pageId) {
|
||||||
this.set('page', pageId);
|
this.set('currentPageId', pageId);
|
||||||
|
|
||||||
let toc = this.get('pages');
|
let toc = this.get('pages');
|
||||||
let page = _.findWhere(toc, { id: pageId });
|
let page = _.findWhere(toc, { id: pageId });
|
||||||
|
@ -94,13 +94,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
let pages = this.get('pages');
|
let pages = this.get('pages');
|
||||||
let page = _.findWhere(pages, { id: this.get('page') });
|
let page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||||
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
||||||
|
|
||||||
if (pendingChanges.length > 0) {
|
if (pendingChanges.length > 0) {
|
||||||
this.attrs.onPageSequenceChange(pendingChanges);
|
this.attrs.onPageSequenceChange(pendingChanges);
|
||||||
|
|
||||||
this.send('onEntryClick', this.get('page'));
|
this.send('onEntryClick', this.get('currentPageId'));
|
||||||
this.audit.record("moved-page-up");
|
this.audit.record("moved-page-up");
|
||||||
this.showNotification("Moved up");
|
this.showNotification("Moved up");
|
||||||
}
|
}
|
||||||
|
@ -114,13 +114,13 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
var pages = this.get('pages');
|
var pages = this.get('pages');
|
||||||
var page = _.findWhere(pages, { id: this.get('page') });
|
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||||
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
||||||
|
|
||||||
if (pendingChanges.length > 0) {
|
if (pendingChanges.length > 0) {
|
||||||
this.attrs.onPageSequenceChange(pendingChanges);
|
this.attrs.onPageSequenceChange(pendingChanges);
|
||||||
|
|
||||||
this.send('onEntryClick', this.get('page'));
|
this.send('onEntryClick', this.get('currentPageId'));
|
||||||
this.audit.record("moved-page-down");
|
this.audit.record("moved-page-down");
|
||||||
this.showNotification("Moved down");
|
this.showNotification("Moved down");
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
var pages = this.get('pages');
|
var pages = this.get('pages');
|
||||||
var page = _.findWhere(pages, { id: this.get('page') });
|
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||||
let pendingChanges = tocUtil.indent(state, pages, page);
|
let pendingChanges = tocUtil.indent(state, pages, page);
|
||||||
|
|
||||||
if (pendingChanges.length > 0) {
|
if (pendingChanges.length > 0) {
|
||||||
|
@ -142,7 +142,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
this.showNotification("Indent");
|
this.showNotification("Indent");
|
||||||
this.audit.record("changed-page-sequence");
|
this.audit.record("changed-page-sequence");
|
||||||
this.send('onEntryClick', this.get('page'));
|
this.send('onEntryClick', this.get('currentPageId'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
var pages = this.get('pages');
|
var pages = this.get('pages');
|
||||||
var page = _.findWhere(pages, { id: this.get('page') });
|
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||||
let pendingChanges = tocUtil.outdent(state, pages, page);
|
let pendingChanges = tocUtil.outdent(state, pages, page);
|
||||||
|
|
||||||
if (pendingChanges.length > 0) {
|
if (pendingChanges.length > 0) {
|
||||||
|
@ -162,7 +162,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
this.showNotification("Outdent");
|
this.showNotification("Outdent");
|
||||||
this.audit.record("changed-page-sequence");
|
this.audit.record("changed-page-sequence");
|
||||||
this.send('onEntryClick', this.get('page'));
|
this.send('onEntryClick', this.get('currentPageId'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,6 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('authenticated', true);
|
self.set('authenticated', true);
|
||||||
self.set('items', response);
|
self.set('items', response);
|
||||||
self.set('config.APIToken', '********'); // reset the api token once it has been sent to the host
|
self.set('config.APIToken', '********'); // reset the api token once it has been sent to the host
|
||||||
console.log("auth token OK");
|
|
||||||
|
|
||||||
self.get('sectionService').fetch(page, "options", config)
|
self.get('sectionService').fetch(page, "options", config)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
|
|
@ -17,11 +17,11 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
this.audit.record("restored-page");
|
this.audit.record("restored-page");
|
||||||
|
|
||||||
this.get('documentService').rollbackPage(this.get('model.document.id'), pageId, revisionId).then(() => {
|
this.get('documentService').rollbackPage(this.get('model.document.id'), pageId, revisionId).then(() => {
|
||||||
this.transitionToRoute('document', {
|
this.transitionToRoute('document.index',
|
||||||
queryParams: {
|
this.get('model.folder.id'),
|
||||||
page: pageId
|
this.get('model.folder.slug'),
|
||||||
}
|
this.get('model.document.id'),
|
||||||
});
|
this.get('model.document.slug'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
folder: {},
|
folder: {},
|
||||||
pages: [],
|
pages: [],
|
||||||
toggled: false,
|
toggled: false,
|
||||||
|
queryParams: ['pageId', 'tab'],
|
||||||
|
pageId: '',
|
||||||
|
tab: 'index',
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleSidebar() {
|
toggleSidebar() {
|
||||||
|
@ -212,7 +215,6 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// tbd
|
|
||||||
onGotoPage(id) {
|
onGotoPage(id) {
|
||||||
this.set('pageId', id);
|
this.set('pageId', id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,18 +17,10 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||||
linkService: Ember.inject.service('link'),
|
linkService: Ember.inject.service('link'),
|
||||||
folderService: Ember.inject.service('folder'),
|
folderService: Ember.inject.service('folder'),
|
||||||
userService: Ember.inject.service('user'),
|
userService: Ember.inject.service('user'),
|
||||||
queryParams: {
|
|
||||||
pageId: {
|
|
||||||
refreshModel: true
|
|
||||||
},
|
|
||||||
tab: {
|
|
||||||
refreshModel: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeModel(transition) {
|
beforeModel(transition) {
|
||||||
this.set('pageId', is.not.undefined(transition.queryParams.pageId) ? transition.queryParams.pageId : '');
|
this.set('pageId', is.not.undefined(transition.queryParams.pageId) ? transition.queryParams.pageId : '');
|
||||||
this.set('tab', is.not.undefined(transition.queryParams.tab) ? transition.queryParams.tab : '');
|
this.set('tab', is.not.undefined(transition.queryParams.tab) ? transition.queryParams.tab : 'index');
|
||||||
},
|
},
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
|
@ -40,11 +32,12 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||||
folders: this.modelFor('document').folders,
|
folders: this.modelFor('document').folders,
|
||||||
folder: this.modelFor('document').folder,
|
folder: this.modelFor('document').folder,
|
||||||
document: this.modelFor('document').document,
|
document: this.modelFor('document').document,
|
||||||
pageId: this.get('pageId'),
|
|
||||||
isEditor: this.get('folderService').get('canEditCurrentFolder'),
|
|
||||||
pages: this.get('documentService').getPages(this.modelFor('document').document.get('id')),
|
pages: this.get('documentService').getPages(this.modelFor('document').document.get('id')),
|
||||||
links: this.modelFor('document').links,
|
links: this.modelFor('document').links,
|
||||||
sections: this.modelFor('document').sections
|
sections: this.modelFor('document').sections,
|
||||||
|
pageId: this.get('pageId'),
|
||||||
|
tab: this.get('tab'),
|
||||||
|
isEditor: this.get('folderService').get('canEditCurrentFolder')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,11 +21,12 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
this.get('model.folder.id'),
|
this.get('model.folder.id'),
|
||||||
this.get('model.folder.slug'),
|
this.get('model.folder.slug'),
|
||||||
this.get('model.document.id'),
|
this.get('model.document.id'),
|
||||||
this.get('model.document.slug'));
|
this.get('model.document.slug'),
|
||||||
|
{ queryParams: { pageId: this.get('model.page.id') }});
|
||||||
},
|
},
|
||||||
|
|
||||||
onAction(page, meta) {
|
onAction(page, meta) {
|
||||||
this.showNotification("Saving");
|
this.showNotification("Saved");
|
||||||
|
|
||||||
let model = {
|
let model = {
|
||||||
page: page.toJSON({ includeId: true }),
|
page: page.toJSON({ includeId: true }),
|
||||||
|
|
|
@ -21,6 +21,7 @@ export default Ember.Service.extend({
|
||||||
appMeta: service(),
|
appMeta: service(),
|
||||||
store: service(),
|
store: service(),
|
||||||
pins: [],
|
pins: [],
|
||||||
|
initialized: false,
|
||||||
|
|
||||||
getUserPins() {
|
getUserPins() {
|
||||||
let userId = this.get('session.user.id');
|
let userId = this.get('session.user.id');
|
||||||
|
@ -41,6 +42,7 @@ export default Ember.Service.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('pins', pins);
|
this.set('pins', pins);
|
||||||
|
this.set('initialized', true);
|
||||||
|
|
||||||
return pins;
|
return pins;
|
||||||
});
|
});
|
||||||
|
@ -102,16 +104,32 @@ export default Ember.Service.extend({
|
||||||
|
|
||||||
isDocumentPinned(documentId) {
|
isDocumentPinned(documentId) {
|
||||||
let userId = this.get('session.user.id');
|
let userId = this.get('session.user.id');
|
||||||
let pins = this.get('pins');
|
|
||||||
let pinId = '';
|
|
||||||
|
|
||||||
pins.forEach((pin) => {
|
if (this.get('initialized') === false) {
|
||||||
if (pin.get('userId') === userId && pin.get('documentId') === documentId) {
|
this.getUserPins().then(() => {
|
||||||
pinId = pin.get('id');
|
let pins = this.get('pins');
|
||||||
}
|
let pinId = '';
|
||||||
});
|
|
||||||
|
|
||||||
return pinId;
|
pins.forEach((pin) => {
|
||||||
|
if (pin.get('userId') === userId && pin.get('documentId') === documentId) {
|
||||||
|
pinId = pin.get('id');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return pinId;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let pins = this.get('pins');
|
||||||
|
let pinId = '';
|
||||||
|
|
||||||
|
pins.forEach((pin) => {
|
||||||
|
if (pin.get('userId') === userId && pin.get('documentId') === documentId) {
|
||||||
|
pinId = pin.get('id');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return pinId;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isSpacePinned(spaceId) {
|
isSpacePinned(spaceId) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.table-editor-wrapper {
|
.table-editor-wrapper {
|
||||||
margin-top: 7px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fr-element,
|
.fr-element,
|
||||||
|
|
|
@ -16,11 +16,12 @@
|
||||||
> .canvas {
|
> .canvas {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.revision-picker {
|
.revision-picker {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 30px;
|
margin-top: 10px;
|
||||||
}
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
|
{{ui-select tagName="span" class="revision-picker" content=revisions action=(action 'onSelectRevision') optionValuePath="id" optionLabelPath="label"}}
|
||||||
|
|
||||||
|
<div id="restore-history-button" class="regular-button button-green pull-right">Restore</div>
|
||||||
|
{{#dropdown-dialog target="restore-history-button" position="bottom right" button="Restore" color="flat-green" onAction=(action 'onRollback')}}
|
||||||
|
<p>Are you sure you want to roll back to this version?</p>
|
||||||
|
{{/dropdown-dialog}}
|
||||||
|
<div class="clearfix" />
|
||||||
|
<div class="margin-bottom-50" />
|
||||||
|
|
||||||
<div class="diff-zone">
|
<div class="diff-zone">
|
||||||
{{ui-select tagName="div" class="revision-picker" content=revisions action=(action 'onSelectRevision') optionValuePath="id" optionLabelPath="label"}}
|
|
||||||
{{#if hasDiff}}
|
{{#if hasDiff}}
|
||||||
<div id="restore-history-button" class="regular-button button-green pull-right">Restore</div>
|
|
||||||
{{#dropdown-dialog target="restore-history-button" position="bottom right" button="Restore" color="flat-green" onAction=(action 'onRollback')}}
|
|
||||||
<p>Are you sure you want to roll back to this version?</p>
|
|
||||||
{{/dropdown-dialog}}
|
|
||||||
<div class="clearfix" />
|
|
||||||
<div class="is-a-page wysiwyg">
|
<div class="is-a-page wysiwyg">
|
||||||
{{{diff}}}
|
{{{diff}}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<ul class="index-list">
|
<ul class="index-list">
|
||||||
{{#each pages key="id" as |p index|}}
|
{{#each pages key="id" as |p index|}}
|
||||||
{{document/index-entry page=p index=index onClick=(action 'onEntryClick')}}
|
{{document/sidebar-view-index-entry page=p index=index onClick=(action 'onEntryClick')}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,18 +15,6 @@
|
||||||
<div class="round-button-mono {{if (is-equal tab 'activity') 'selected'}}" {{action 'onChangeTab' 'activity'}}>
|
<div class="round-button-mono {{if (is-equal tab 'activity') 'selected'}}" {{action 'onChangeTab' 'activity'}}>
|
||||||
<i class="material-icons">timeline</i>
|
<i class="material-icons">timeline</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top-20"></div>
|
|
||||||
<div class="round-button-mono {{if (is-equal tab 'feedback') 'feedback'}}" {{action 'onChangeTab' 'feedback'}}>
|
|
||||||
<i class="material-icons">chat_bubble</i>
|
|
||||||
</div>
|
|
||||||
<div class="margin-top-20"></div>
|
|
||||||
<div class="round-button-mono {{if (is-equal tab 'actions') 'selected'}}" {{action 'onChangeTab' 'actions'}}>
|
|
||||||
<i class="material-icons">person</i>
|
|
||||||
</div>
|
|
||||||
<div class="margin-top-20"></div>
|
|
||||||
<div class="round-button-mono {{if (is-equal tab 'share') 'selected'}}" {{action 'onChangeTab' 'share'}}>
|
|
||||||
<i class="material-icons">share</i>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -50,18 +38,6 @@
|
||||||
{{#if (is-equal tab 'activity')}}
|
{{#if (is-equal tab 'activity')}}
|
||||||
{{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}}
|
{{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (is-equal tab 'feedback')}}
|
|
||||||
{{enterprise/sidebar-view-feedback document=document isEditor=isEditor}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (is-equal tab 'actions')}}
|
|
||||||
{{enterprise/sidebar-view-actions document=document folder=folder isEditor=isEditor}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (is-equal tab 'share')}}
|
|
||||||
{{enterprise/sidebar-view-share document=document isEditor=isEditor}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#dropdown-menu target="sidebar-zone-more-button" position="bottom right" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}}
|
{{#dropdown-menu target="sidebar-zone-more-button" position="bottom right" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}}
|
||||||
|
@ -93,6 +69,18 @@
|
||||||
{{/dropdown-menu}}
|
{{/dropdown-menu}}
|
||||||
|
|
||||||
{{#if session.authenticated}}
|
{{#if session.authenticated}}
|
||||||
|
{{#if menuOpen}}
|
||||||
|
{{#unless pinState.isPinned}}
|
||||||
|
{{#dropdown-dialog target="pin-document-button" position="bottom right" button="Pin" color="flat-green" onAction=(action 'onPin') focusOn="pin-document-name" }}
|
||||||
|
<div class="input-control">
|
||||||
|
<label>Pin Document</label>
|
||||||
|
<div class="tip">A 3 or 4 character name</div>
|
||||||
|
{{input type='text' id="pin-document-name" value=pinState.newName}}
|
||||||
|
</div>
|
||||||
|
{{/dropdown-dialog}}
|
||||||
|
{{/unless}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if isEditor}}
|
{{#if isEditor}}
|
||||||
{{#if menuOpen}}
|
{{#if menuOpen}}
|
||||||
{{#dropdown-dialog target="delete-document-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDeleteDocument')}}
|
{{#dropdown-dialog target="delete-document-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDeleteDocument')}}
|
||||||
|
@ -100,16 +88,6 @@
|
||||||
<p>There is no undo, so be careful.</p>
|
<p>There is no undo, so be careful.</p>
|
||||||
{{/dropdown-dialog}}
|
{{/dropdown-dialog}}
|
||||||
|
|
||||||
{{#unless pinState.isPinned}}
|
|
||||||
{{#dropdown-dialog target="pin-document-button" position="bottom right" button="Pin" color="flat-green" onAction=(action 'onPin') focusOn="pin-document-name" }}
|
|
||||||
<div class="input-control">
|
|
||||||
<label>Pin Document</label>
|
|
||||||
<div class="tip">A 3 or 4 character name</div>
|
|
||||||
{{input type='text' id="pin-document-name" value=pinState.newName}}
|
|
||||||
</div>
|
|
||||||
{{/dropdown-dialog}}
|
|
||||||
{{/unless}}
|
|
||||||
|
|
||||||
{{#dropdown-dialog target="save-template-button" position="bottom right" button="Save as Template" color="flat-green" onAction=(action 'onSaveTemplate') focusOn="new-template-name" }}
|
{{#dropdown-dialog target="save-template-button" position="bottom right" button="Save as Template" color="flat-green" onAction=(action 'onSaveTemplate') focusOn="new-template-name" }}
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
<label>Name</label>
|
<label>Name</label>
|
||||||
|
|
|
@ -41,6 +41,7 @@ module.exports = function (defaults) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.import('vendor/documize.js');
|
||||||
app.import('vendor/dropzone.js');
|
app.import('vendor/dropzone.js');
|
||||||
app.import('vendor/is.js');
|
app.import('vendor/is.js');
|
||||||
app.import('vendor/md5.js');
|
app.import('vendor/md5.js');
|
||||||
|
|
31
app/vendor/documize.js
vendored
Normal file
31
app/vendor/documize.js
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||||
|
//
|
||||||
|
// This software (Documize Community Edition) is licensed under
|
||||||
|
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
//
|
||||||
|
// You can operate outside the AGPL restrictions by purchasing
|
||||||
|
// Documize Enterprise Edition and obtaining a commercial license
|
||||||
|
// by contacting <sales@documize.com>.
|
||||||
|
//
|
||||||
|
// https://documize.com
|
||||||
|
|
||||||
|
$.fn.inView = function(){
|
||||||
|
let win = $(window);
|
||||||
|
let obj = $(this);
|
||||||
|
|
||||||
|
// trap for no object
|
||||||
|
if (obj.length === 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the top Scroll Position in the page
|
||||||
|
let scrollPosition = win.scrollTop();
|
||||||
|
|
||||||
|
// the end of the visible area in the page, starting from the scroll position
|
||||||
|
let visibleArea = win.scrollTop() + win.height();
|
||||||
|
|
||||||
|
// we check to see if the start of object is in view
|
||||||
|
let objPos = obj.offset().top;// + obj.outerHeight();
|
||||||
|
|
||||||
|
return(visibleArea >= objPos && scrollPosition <= objPos ? true : false);
|
||||||
|
};
|
|
@ -1090,6 +1090,7 @@ func CopyPage(w http.ResponseWriter, r *http.Request) {
|
||||||
newPageID := util.UniqueID()
|
newPageID := util.UniqueID()
|
||||||
page.RefID = newPageID
|
page.RefID = newPageID
|
||||||
page.Level = 1
|
page.Level = 1
|
||||||
|
page.Sequence = 0
|
||||||
page.DocumentID = targetID
|
page.DocumentID = targetID
|
||||||
page.UserID = p.Context.UserID
|
page.UserID = p.Context.UserID
|
||||||
pageMeta.DocumentID = targetID
|
pageMeta.DocumentID = targetID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue