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
|
||||
|
||||
v1.56.1
|
||||
v1.57.0
|
||||
|
||||
## 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
|
||||
|
||||
echo "Generating in-memory static assets..."
|
||||
go get -u github.com/jteeuwen/go-bindata/...
|
||||
go get -u github.com/elazarl/go-bindata-assetfs/...
|
||||
# go get -u github.com/jteeuwen/go-bindata/...
|
||||
# go get -u github.com/elazarl/go-bindata-assetfs/...
|
||||
cd embed
|
||||
go generate
|
||||
|
||||
|
|
|
@ -112,5 +112,5 @@ func (p *Provider) generateDiagram(ctx *provider.Context, data string) string {
|
|||
png, _ := ioutil.ReadAll(resp.Body)
|
||||
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
|
||||
rt.Product = env.ProdInfo{}
|
||||
rt.Product.Major = "1"
|
||||
rt.Product.Minor = "56"
|
||||
rt.Product.Patch = "1"
|
||||
rt.Product.Minor = "57"
|
||||
rt.Product.Patch = "0"
|
||||
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
|
||||
rt.Product.Edition = "Community"
|
||||
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() {
|
||||
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;
|
||||
}),
|
||||
hasBlocks: computed('blocks', function() {
|
||||
return this.get('blocks.length') > 0;
|
||||
}),
|
||||
mousetrap: null,
|
||||
|
||||
didRender() {
|
||||
this._super(...arguments);
|
||||
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() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('session.authenticated')) {
|
||||
this.setupAddWizard();
|
||||
// this.setupAddWizard();
|
||||
this.renderTooltips();
|
||||
}
|
||||
|
||||
|
@ -64,6 +74,11 @@ export default Component.extend(TooltipMixin, {
|
|||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
this.removeTooltips();
|
||||
}
|
||||
|
||||
let mousetrap = this.get('mousetrap');
|
||||
if (is.not.null(mousetrap)) {
|
||||
mousetrap.unbind('esc');
|
||||
}
|
||||
},
|
||||
|
||||
contentLinkHandler() {
|
||||
|
@ -101,19 +116,19 @@ export default Component.extend(TooltipMixin, {
|
|||
});
|
||||
},
|
||||
|
||||
setupAddWizard() {
|
||||
schedule('afterRender', () => {
|
||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
// setupAddWizard() {
|
||||
// schedule('afterRender', () => {
|
||||
// $('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
|
||||
$('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||
// in
|
||||
$(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||
}, out: function() {
|
||||
// out
|
||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
});
|
||||
},
|
||||
// $('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||
// // in
|
||||
// $(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||
// }, out: function() {
|
||||
// // out
|
||||
// $(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
// } });
|
||||
// });
|
||||
// },
|
||||
|
||||
addSection(model) {
|
||||
let sequence = 0;
|
||||
|
@ -280,7 +295,7 @@ export default Component.extend(TooltipMixin, {
|
|||
const promise = this.addSection(model);
|
||||
promise.then((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);
|
||||
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 mousetrap = this.get('mousetrap');
|
||||
|
||||
if (is.null(mousetrap)) {
|
||||
mousetrap = new Mousetrap(msContainer);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ export default Component.extend({
|
|||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
schedule('afterRender', () => {
|
||||
let options = {
|
||||
cache_suffix: "?v=454",
|
||||
|
@ -49,7 +49,7 @@ export default Component.extend({
|
|||
theme: "modern",
|
||||
skin: 'lightgray-gradient',
|
||||
entity_encoding: "raw",
|
||||
extended_valid_elements: "b,i,b/strong,i/em",
|
||||
extended_valid_elements: "b,i,b/strong,i/em",
|
||||
fontsize_formats: "8px 10px 12px 14px 17px 18px 24px 36px 40px 50px 60px",
|
||||
formats: {
|
||||
bold: {
|
||||
|
|
|
@ -1,32 +1,28 @@
|
|||
.start-section {
|
||||
@extend .no-select;
|
||||
height: 60px;
|
||||
background-color: transparent;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
font-size: 1.3rem;
|
||||
|
||||
> .start-button {
|
||||
display: none;
|
||||
text-align: center;
|
||||
padding-top: 10px;
|
||||
margin: 60px 0;
|
||||
position: relative;
|
||||
}
|
||||
color: $color-gray-light;
|
||||
|
||||
&:first-of-type {
|
||||
height: 30px;
|
||||
> .cta {
|
||||
@include ease-in();
|
||||
font-weight: bold;
|
||||
letter-spacing: 0.22rem;
|
||||
|
||||
> .start-button {
|
||||
padding: 0;
|
||||
&:hover {
|
||||
color: $color-green;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.start-section-empty-state {
|
||||
> .start-button {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.new-section-wizard {
|
||||
display: none;
|
||||
@include border-radius(2px);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{#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-button">
|
||||
<div class="btn btn-success font-weight-bold">+ SECTION</div>
|
||||
<div class="cta">+ SECTION</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
|
@ -19,7 +19,7 @@
|
|||
{{#if canEdit}}
|
||||
<div class="start-section" data-index="0" data-before-id="0" id="add-section-button-0" {{action 'onShowSectionWizard'}}>
|
||||
<div class="start-button">
|
||||
<div class="btn btn-success font-weight-bold">+ SECTION</div>
|
||||
<div class="cta">+ SECTION</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -27,9 +27,9 @@
|
|||
|
||||
{{#unless hasPages}}
|
||||
{{#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="btn btn-success font-weight-bold">+ SECTION</div>
|
||||
<div class="cta">+ SECTION</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -42,14 +42,14 @@
|
|||
<div class="row clearfix">
|
||||
<div class="col-12 clearfix">
|
||||
<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 class="row">
|
||||
<div class="col-12">
|
||||
<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>
|
||||
|
|
|
@ -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')
|
||||
isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||
<div id='#mytoolbar'></div>
|
||||
<div id={{editorId}} class="mousetrap wysiwyg wysiwyg-editor">
|
||||
{{{pageBody}}}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "documize",
|
||||
"version": "1.56.1",
|
||||
"version": "1.57.0",
|
||||
"description": "The Document IDE",
|
||||
"private": true,
|
||||
"repository": "",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue