Fixed form entries. Fixed error logs when canceling a modal.

This commit is contained in:
Benoit Schweblin 2017-10-02 20:09:39 +01:00
parent 73cea1879d
commit fb95df2e14
8 changed files with 132 additions and 100 deletions

View File

@ -224,4 +224,66 @@ export default {
margin-left: 5px;
}
}
.form-entry {
margin: 1em 0;
}
.form-entry__label {
display: block;
font-size: 0.9rem;
color: #a0a0a0;
.form-entry--focused & {
color: darken($link-color, 10%);
}
}
.form-entry__field {
border: 1px solid #d8d8d8;
border-radius: $border-radius-base;
position: relative;
overflow: hidden;
.form-entry--focused & {
border-color: $link-color;
}
}
.form-entry__actions {
text-align: right;
margin: 0.25em;
}
.form-entry__button {
width: 38px;
height: 38px;
padding: 6px;
display: inline-block;
background-color: transparent;
opacity: 0.75;
&:active,
&:focus,
&:hover {
opacity: 1;
background-color: rgba(0, 0, 0, 0.1);
}
}
.form-entry__radio,
.form-entry__checkbox {
margin: 0.25em 1em;
input {
margin-right: 0.25em;
}
}
.form-entry__info {
font-size: 0.75em;
opacity: 0.5;
line-height: 1.4;
margin: 0.25em 0;
}
</style>

View File

@ -29,10 +29,12 @@ export default {
methods: {
exportMarkdown() {
const currentFile = this.$store.getters['file/current'];
return exportSvc.exportToDisk(currentFile.id, 'md');
return exportSvc.exportToDisk(currentFile.id, 'md')
.catch(() => {}); // Cancel
},
exportHtml() {
return this.$store.dispatch('modal/open', 'htmlExport');
return this.$store.dispatch('modal/open', 'htmlExport')
.catch(() => {}); // Cancel
},
exportPdf() {
return this.$store.dispatch('modal/notImplemented');

View File

@ -75,13 +75,17 @@ export default {
}),
signin() {
return googleHelper.signin()
.then(() => syncSvc.requestSync());
.then(
() => syncSvc.requestSync(),
() => {}, // Cancel
);
},
importFile() {
return this.$store.dispatch('modal/notImplemented');
},
fileProperties() {
return this.$store.dispatch('modal/open', 'fileProperties');
return this.$store.dispatch('modal/open', 'fileProperties')
.catch(() => {}); // Cancel
},
},
};

View File

@ -42,15 +42,24 @@ export default {
methods: {
settings() {
return this.$store.dispatch('modal/open', 'settings')
.then(settings => this.$store.dispatch('data/setSettings', settings));
.then(
settings => this.$store.dispatch('data/setSettings', settings),
() => {}, // Cancel
);
},
templates() {
return this.$store.dispatch('modal/open', 'templates')
.then(({ templates }) => this.$store.dispatch('data/setTemplates', templates));
.then(
({ templates }) => this.$store.dispatch('data/setTemplates', templates),
() => {}, // Cancel
);
},
reset() {
return this.$store.dispatch('modal/reset')
.then(() => localDbSvc.removeDb());
.then(
() => localDbSvc.removeDb(),
() => {}, // Cancel
);
},
about() {
return this.$store.dispatch('modal/open', 'about');

View File

@ -161,55 +161,69 @@ export default {
return this.$store.dispatch('modal/open', 'publishManagement');
},
addGoogleDriveAccount() {
return googleHelper.addDriveAccount();
return googleHelper.addDriveAccount()
.catch(() => {}); // Cancel
},
addDropboxAccount() {
return this.$store.dispatch('modal/open', {
type: 'dropboxAccount',
onResolve: () => dropboxHelper.addAccount(!store.getters['data/localSettings'].dropboxRestrictedAccess),
});
})
.catch(() => {}); // Cancel
},
addGithubAccount() {
return this.$store.dispatch('modal/open', {
type: 'githubAccount',
onResolve: () => githubHelper.addAccount(store.getters['data/localSettings'].githubRepoFullAccess),
});
})
.catch(() => {}); // Cancel
},
addWordpressAccount() {
return wordpressHelper.addAccount();
return wordpressHelper.addAccount()
.catch(() => {}); // Cancel
},
addBloggerAccount() {
return googleHelper.addBloggerAccount();
return googleHelper.addBloggerAccount()
.catch(() => {}); // Cancel
},
addZendeskAccount() {
return this.$store.dispatch('modal/open', {
type: 'zendeskAccount',
onResolve: ({ subdomain, clientId }) => zendeskHelper.addAccount(subdomain, clientId),
});
})
.catch(() => {}); // Cancel
},
publishGoogleDrive(token) {
return openPublishModal(token, 'googleDrivePublish');
return openPublishModal(token, 'googleDrivePublish')
.catch(() => {}); // Cancel
},
publishDropbox(token) {
return openPublishModal(token, 'dropboxPublish');
return openPublishModal(token, 'dropboxPublish')
.catch(() => {}); // Cancel
},
publishGithub(token) {
return openPublishModal(token, 'githubPublish');
return openPublishModal(token, 'githubPublish')
.catch(() => {}); // Cancel
},
publishGist(token) {
return openPublishModal(token, 'gistPublish');
return openPublishModal(token, 'gistPublish')
.catch(() => {}); // Cancel
},
publishWordpress(token) {
return openPublishModal(token, 'wordpressPublish');
return openPublishModal(token, 'wordpressPublish')
.catch(() => {}); // Cancel
},
publishBlogger(token) {
return openPublishModal(token, 'bloggerPublish');
return openPublishModal(token, 'bloggerPublish')
.catch(() => {}); // Cancel
},
publishBloggerPage(token) {
return openPublishModal(token, 'bloggerPagePublish');
return openPublishModal(token, 'bloggerPagePublish')
.catch(() => {}); // Cancel
},
publishZendesk(token) {
return openPublishModal(token, 'zendeskPublish');
return openPublishModal(token, 'zendeskPublish')
.catch(() => {}); // Cancel
},
},
};

View File

@ -138,19 +138,22 @@ export default {
return this.$store.dispatch('modal/open', 'syncManagement');
},
addGoogleDriveAccount() {
return googleHelper.addDriveAccount();
return googleHelper.addDriveAccount()
.catch(() => {}); // Cancel
},
addDropboxAccount() {
return this.$store.dispatch('modal/open', {
type: 'dropboxAccount',
onResolve: () => dropboxHelper.addAccount(!store.getters['data/localSettings'].dropboxRestrictedAccess),
});
})
.catch(() => {}); // Cancel
},
addGithubAccount() {
return this.$store.dispatch('modal/open', {
type: 'githubAccount',
onResolve: () => githubHelper.addAccount(store.getters['data/localSettings'].githubRepoFullAccess),
});
})
.catch(() => {}); // Cancel
},
openGoogleDrive(token) {
return googleHelper.openPicker(token, 'doc')
@ -163,16 +166,20 @@ export default {
() => dropboxProvider.openFiles(token, paths)));
},
saveGoogleDrive(token) {
return openSyncModal(token, 'googleDriveSync');
return openSyncModal(token, 'googleDriveSync')
.catch(() => {}); // Cancel
},
saveDropbox(token) {
return openSyncModal(token, 'dropboxSync');
return openSyncModal(token, 'dropboxSync')
.catch(() => {}); // Cancel
},
saveGithub(token) {
return openSyncModal(token, 'githubSync');
return openSyncModal(token, 'githubSync')
.catch(() => {}); // Cancel
},
saveGist(token) {
return openSyncModal(token, 'gistSync');
return openSyncModal(token, 'gistSync')
.catch(() => {}); // Cancel
},
},
};

View File

@ -21,69 +21,3 @@ export default {
},
};
</script>
<style lang="scss">
@import '../common/variables.scss';
.form-entry {
margin: 1em 0;
}
.form-entry__label {
display: block;
font-size: 0.9rem;
color: #a0a0a0;
.form-entry--focused & {
color: darken($link-color, 10%);
}
}
.form-entry__field {
border: 1px solid #d8d8d8;
border-radius: $border-radius-base;
position: relative;
overflow: hidden;
.form-entry--focused & {
border-color: $link-color;
}
}
.form-entry__actions {
text-align: right;
margin: 0.25em;
}
.form-entry__button {
width: 38px;
height: 38px;
padding: 6px;
display: inline-block;
background-color: transparent;
opacity: 0.75;
&:active,
&:focus,
&:hover {
opacity: 1;
background-color: rgba(0, 0, 0, 0.1);
}
}
.form-entry__radio,
.form-entry__checkbox {
margin: 0.25em 1em;
input {
margin-right: 0.25em;
}
}
.form-entry__info {
font-size: 0.75em;
opacity: 0.5;
line-height: 1.4;
margin: 0.25em 0;
}
</style>

View File

@ -231,12 +231,6 @@ module.exports = function (options) {
}
var rest = {}
rest.code = {
pattern: /(`+)[\s\S]*?\1/g,
inside: {
'cl cl-code': /`/
}
}
if (options.maths) {
rest['math block'] = {
pattern: /\\\\\[[\s\S]*?\\\\\]/g,
@ -278,6 +272,12 @@ module.exports = function (options) {
}
}
}
rest.code = {
pattern: /(`+)[\s\S]*?\1/g,
inside: {
'cl cl-code': /`/
}
}
if (options.footnotes) {
rest.inlinefn = {
pattern: /\^\[.+?\]/g,