mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Enhance + SECTION to always be visible
This commit is contained in:
parent
7d3473365a
commit
9d82682797
12 changed files with 771 additions and 762 deletions
|
@ -52,7 +52,7 @@ Space view.
|
||||||
|
|
||||||
## Latest version
|
## Latest version
|
||||||
|
|
||||||
v1.56.1
|
v1.57.0
|
||||||
|
|
||||||
## OS support
|
## OS support
|
||||||
|
|
||||||
|
|
4
build.sh
4
build.sh
|
@ -30,8 +30,8 @@ mkdir -p embed/bindata/scripts
|
||||||
cp -r core/database/scripts/autobuild/*.sql embed/bindata/scripts
|
cp -r core/database/scripts/autobuild/*.sql embed/bindata/scripts
|
||||||
|
|
||||||
echo "Generating in-memory static assets..."
|
echo "Generating in-memory static assets..."
|
||||||
go get -u github.com/jteeuwen/go-bindata/...
|
# go get -u github.com/jteeuwen/go-bindata/...
|
||||||
go get -u github.com/elazarl/go-bindata-assetfs/...
|
# go get -u github.com/elazarl/go-bindata-assetfs/...
|
||||||
cd embed
|
cd embed
|
||||||
go generate
|
go generate
|
||||||
|
|
||||||
|
|
|
@ -112,5 +112,5 @@ func (p *Provider) generateDiagram(ctx *provider.Context, data string) string {
|
||||||
png, _ := ioutil.ReadAll(resp.Body)
|
png, _ := ioutil.ReadAll(resp.Body)
|
||||||
pngEncoded := base64.StdEncoding.EncodeToString(png)
|
pngEncoded := base64.StdEncoding.EncodeToString(png)
|
||||||
|
|
||||||
return string(fmt.Sprintf("data:image/png;base64, %s", pngEncoded))
|
return string(fmt.Sprintf("data:image/png;base64,%s", pngEncoded))
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,8 @@ func main() {
|
||||||
// product details
|
// product details
|
||||||
rt.Product = env.ProdInfo{}
|
rt.Product = env.ProdInfo{}
|
||||||
rt.Product.Major = "1"
|
rt.Product.Major = "1"
|
||||||
rt.Product.Minor = "56"
|
rt.Product.Minor = "57"
|
||||||
rt.Product.Patch = "1"
|
rt.Product.Patch = "0"
|
||||||
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
||||||
rt.Product.Edition = "Community"
|
rt.Product.Edition = "Community"
|
||||||
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -34,23 +34,33 @@ export default Component.extend(TooltipMixin, {
|
||||||
canEdit: computed('permissions', 'document.protection', function() {
|
canEdit: computed('permissions', 'document.protection', function() {
|
||||||
let canEdit = this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
|
let canEdit = this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
|
||||||
|
|
||||||
if (canEdit) this.setupAddWizard();
|
// if (canEdit) this.setupAddWizard();
|
||||||
return canEdit;
|
return canEdit;
|
||||||
}),
|
}),
|
||||||
hasBlocks: computed('blocks', function() {
|
hasBlocks: computed('blocks', function() {
|
||||||
return this.get('blocks.length') > 0;
|
return this.get('blocks.length') > 0;
|
||||||
}),
|
}),
|
||||||
|
mousetrap: null,
|
||||||
|
|
||||||
didRender() {
|
didRender() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
this.contentLinkHandler();
|
this.contentLinkHandler();
|
||||||
|
|
||||||
|
let mousetrap = this.get('mousetrap');
|
||||||
|
let msContainer = document.getElementById('new-section-wizard');
|
||||||
|
if (is.null(mousetrap)) mousetrap = new Mousetrap(msContainer);
|
||||||
|
|
||||||
|
mousetrap.bind('esc', () => {
|
||||||
|
this.send('onHideSectionWizard');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
if (this.get('session.authenticated')) {
|
if (this.get('session.authenticated')) {
|
||||||
this.setupAddWizard();
|
// this.setupAddWizard();
|
||||||
this.renderTooltips();
|
this.renderTooltips();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +74,11 @@ export default Component.extend(TooltipMixin, {
|
||||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||||
this.removeTooltips();
|
this.removeTooltips();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mousetrap = this.get('mousetrap');
|
||||||
|
if (is.not.null(mousetrap)) {
|
||||||
|
mousetrap.unbind('esc');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
contentLinkHandler() {
|
contentLinkHandler() {
|
||||||
|
@ -101,19 +116,19 @@ export default Component.extend(TooltipMixin, {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setupAddWizard() {
|
// setupAddWizard() {
|
||||||
schedule('afterRender', () => {
|
// schedule('afterRender', () => {
|
||||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
// $('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||||
|
|
||||||
$('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
|
// $('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||||
// in
|
// // in
|
||||||
$(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
// $(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||||
}, out: function() {
|
// }, out: function() {
|
||||||
// out
|
// // out
|
||||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
// $(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||||
} });
|
// } });
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
|
|
||||||
addSection(model) {
|
addSection(model) {
|
||||||
let sequence = 0;
|
let sequence = 0;
|
||||||
|
@ -280,7 +295,7 @@ export default Component.extend(TooltipMixin, {
|
||||||
const promise = this.addSection(model);
|
const promise = this.addSection(model);
|
||||||
promise.then((id) => {
|
promise.then((id) => {
|
||||||
this.set('toEdit', model.page.pageType === 'section' ? id: '');
|
this.set('toEdit', model.page.pageType === 'section' ? id: '');
|
||||||
this.setupAddWizard();
|
// this.setupAddWizard();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -313,7 +328,7 @@ export default Component.extend(TooltipMixin, {
|
||||||
|
|
||||||
const promise = this.addSection(model);
|
const promise = this.addSection(model);
|
||||||
promise.then((id) => { // eslint-disable-line no-unused-vars
|
promise.then((id) => { // eslint-disable-line no-unused-vars
|
||||||
this.setupAddWizard();
|
// this.setupAddWizard();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ export default Component.extend(TooltipMixin, ModalMixin, {
|
||||||
|
|
||||||
let msContainer = document.getElementById('section-editor-' + this.get('containerId'));
|
let msContainer = document.getElementById('section-editor-' + this.get('containerId'));
|
||||||
let mousetrap = this.get('mousetrap');
|
let mousetrap = this.get('mousetrap');
|
||||||
|
|
||||||
if (is.null(mousetrap)) {
|
if (is.null(mousetrap)) {
|
||||||
mousetrap = new Mousetrap(msContainer);
|
mousetrap = new Mousetrap(msContainer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,25 @@
|
||||||
.start-section {
|
.start-section {
|
||||||
@extend .no-select;
|
@extend .no-select;
|
||||||
height: 60px;
|
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
|
||||||
> .start-button {
|
> .start-button {
|
||||||
display: none;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 10px;
|
margin: 60px 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
color: $color-gray-light;
|
||||||
|
|
||||||
&:first-of-type {
|
> .cta {
|
||||||
height: 30px;
|
@include ease-in();
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 0.22rem;
|
||||||
|
|
||||||
> .start-button {
|
&:hover {
|
||||||
padding: 0;
|
color: $color-green;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.start-section-empty-state {
|
|
||||||
> .start-button {
|
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{#if canEdit}}
|
{{#if canEdit}}
|
||||||
<div class="start-section" data-index={{index}} data-before-id={{item.page.id}} id="add-section-button-{{item.page.id}}" {{action 'onShowSectionWizard' item.page}}>
|
<div class="start-section" data-index={{index}} data-before-id={{item.page.id}} id="add-section-button-{{item.page.id}}" {{action 'onShowSectionWizard' item.page}}>
|
||||||
<div class="start-button">
|
<div class="start-button">
|
||||||
<div class="btn btn-success font-weight-bold">+ SECTION</div>
|
<div class="cta">+ SECTION</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
{{#if canEdit}}
|
{{#if canEdit}}
|
||||||
<div class="start-section" data-index="0" data-before-id="0" id="add-section-button-0" {{action 'onShowSectionWizard'}}>
|
<div class="start-section" data-index="0" data-before-id="0" id="add-section-button-0" {{action 'onShowSectionWizard'}}>
|
||||||
<div class="start-button">
|
<div class="start-button">
|
||||||
<div class="btn btn-success font-weight-bold">+ SECTION</div>
|
<div class="cta">+ SECTION</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -27,9 +27,9 @@
|
||||||
|
|
||||||
{{#unless hasPages}}
|
{{#unless hasPages}}
|
||||||
{{#if canEdit}}
|
{{#if canEdit}}
|
||||||
<div class="start-section start-section-empty-state" data-index="-1" data-before-id="0" id="add-section-button-0" {{action 'onShowSectionWizard'}}>
|
<div class="start-section" data-index="-1" data-before-id="0" id="add-section-button-0" {{action 'onShowSectionWizard'}}>
|
||||||
<div class="start-button">
|
<div class="start-button">
|
||||||
<div class="btn btn-success font-weight-bold">+ SECTION</div>
|
<div class="cta">+ SECTION</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -42,14 +42,14 @@
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-12 clearfix">
|
<div class="col-12 clearfix">
|
||||||
<div class="float-right mb-5">
|
<div class="float-right mb-5">
|
||||||
<button type="button" class="btn btn-secondary" {{action 'onHideSectionWizard'}}>Cancel</button>
|
<button type="button" class="btn btn-secondary" {{action 'onHideSectionWizard'}}>Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{{input type="text" id="new-section-name" value=newSectionName class=(if newSectionNameMissing 'form-control form-control-lg is-invalid' 'form-control form-control-lg') placeholder="Enter section name" autocomplete="off"}}
|
{{input type="text" id="new-section-name" value=newSectionName class=(if newSectionNameMissing 'mousetrap form-control form-control-lg is-invalid' 'mousetrap form-control form-control-lg') placeholder="Enter section name" autocomplete="off"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{{#section/base-editor-inline document=document folder=folder page=page
|
{{#section/base-editor-inline document=document folder=folder page=page
|
||||||
blockMode=blockMode contentLinkerButton=true onInsertLink=(action 'onInsertLink')
|
blockMode=blockMode contentLinkerButton=true onInsertLink=(action 'onInsertLink')
|
||||||
isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||||
<div id='#mytoolbar'></div>
|
|
||||||
<div id={{editorId}} class="mousetrap wysiwyg wysiwyg-editor">
|
<div id={{editorId}} class="mousetrap wysiwyg wysiwyg-editor">
|
||||||
{{{pageBody}}}
|
{{{pageBody}}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "documize",
|
"name": "documize",
|
||||||
"version": "1.56.1",
|
"version": "1.57.0",
|
||||||
"description": "The Document IDE",
|
"description": "The Document IDE",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": "",
|
"repository": "",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue