Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/abecms/abecms
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed May 19, 2017
2 parents c12eae2 + 5e069bd commit eedcdf2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ If you want us to add your sites, submit a PR of this README.
- Askja: http://www.askja-audio.com/
- eNewsletters Novotel (become a member to see the newsletters ;)
- eNewsletters Accor Club (become a member to see the newsletters ;)
- http://www.mariderm.com/
- http://www.peauologie.com/
- http://paysagementbelisle.com/
- ...

# Recipes, plugins, blogs
Expand Down
5 changes: 4 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ The 3.x releases will focus on the REST layer of AbeCMS.
- A JSON document could be associated with more than 1 template: AMP template, mobile, template, instant article template, desktop template...
- We must be able to chose a theme (composed by templates) from the admin
- We should be able to sync data, templates, ... from a distant Abe install
- Let's improve the republish-all so that we boost the performance.
- ~~Let's improve the republish-all so that we boost the performance.~~
- Add an init option to Abe CLI to ease the creation of a project
- Add a deploy option to the web through surge.sh CLI in Abe CLI
- Add a -d (--dev) option to Abe CLI so that we can have livereload and debug features during template dev

## Changelog
See the complete [changelog](./CHANGELOG.md)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abecms",
"version": "3.2.2",
"version": "3.2.3",
"description": "Abe: The lightning fast CMS",
"main": "src/server/app.js",
"repository": {
Expand Down
13 changes: 11 additions & 2 deletions src/cli/cms/reference/reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ export function getFiles(name = '') {
}

export function saveFile(url, json) {
fse.writeJson(path.join(config.root, config.reference.url, url), JSON.parse(json), function (err) {
if(err) console.log('saveFile reference error: ', err)
fse.exists(path.join(config.root, config.reference.url), function (exists) {
if(!exists){
fse.mkdir(path.join(config.root, config.reference.url), function () {
fse.writeJson(path.join(config.root, config.reference.url, url), JSON.parse(json))
})
}
else{
fse.writeJson(path.join(config.root, config.reference.url, url), JSON.parse(json), function (err) {
if(err) console.log('saveFile reference error: ', err)
})
}
})
}
4 changes: 2 additions & 2 deletions src/server/public/abecms/scripts/modules/EditorReferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import qs from 'qs'
export default class EditorReferences {
constructor() {
this._ajax = Nanoajax.ajax
this.filenameInput = document.querySelector('.filename-input')
if(typeof this.filenameInput === 'undefined' || this.filenameInput === null) return
this.referenceLinks = document.querySelectorAll('[data-ref-json]')
if(!this.referenceLinks || this.referenceLinks.length < 1) return
this.textArea = document.querySelector('.display-json')
this.jsonError = document.querySelector('.json-error')
this.addReference = document.querySelector('.btn-add-reference')
this.addReferenceInput = document.querySelector('.btn-add-reference input')
if(!this.referenceLinks || this.referenceLinks.length < 1) return
this.nameError = this.addReference.querySelector('.error-display')
this.rebind()
}
Expand Down
7 changes: 7 additions & 0 deletions src/server/public/abecms/scripts/modules/EditorSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export default class EditorSave {
delete this._json.data[obj][index]
if(this._json.data[obj].length == 1) delete this._json.data[obj]
}
else if(typeof input.getAttribute('data-size') !== null && input.getAttribute('data-size') !== null){
var sizes = input.getAttribute('data-size').split(',')
for (var i = 0; i < sizes.length; i++) {
var sizeValue = value.replace(/\.(jpg|jpeg|png|gif|svg)/, '_' + sizes[i] + '.$1');
setObjByString(this._json.data[obj][index], `${keyJson}_${sizes[i]}`, sizeValue)
}
}
} else {
if (input.getAttribute('data-autocomplete') === 'true' || input.getAttribute('data-multiple') === 'multiple') {
var results = input.parentNode.querySelectorAll('.autocomplete-result-wrapper .autocomplete-result')
Expand Down

0 comments on commit eedcdf2

Please sign in to comment.