diff --git a/Gruntfile.js b/Gruntfile.js index f308b1a..8599033 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,18 +4,16 @@ module.exports = function(grunt) { var now = new Date(); var version = '-' + dateFormat(now, "yyyy-mm-dd-hh-MM"); - var mapToSrcFolder = function (path) { + // get the list of scripts paths to include + var piskelScripts = require('./src/piskel-script-list.js').scripts.map(function (path) { return "src/" + path; - }; - - var piskelScripts = require('./src/piskel-script-list.js').scripts.map(mapToSrcFolder).filter(function (path) { + }).filter(function (path) { return path.indexOf('devtools') === -1; }); - var piskelStyles = require('./src/piskel-style-list.js').styles.map(mapToSrcFolder); - - var mapToCasperFolder = function (path) { - return "test/casperjs/" + path; - }; + // get the list of styles paths to include + var piskelStyles = require('./src/piskel-style-list.js').styles.map(function (path) { + return "src/" + path; + }); var casperEnvironments = { 'local' : { @@ -30,7 +28,9 @@ module.exports = function(grunt) { var getCasperConfig = function (env) { var conf = casperEnvironments[env]; - var tests = require(conf.suite).tests.map(mapToCasperFolder); + var tests = require(conf.suite).tests.map(function (path) { + return "test/casperjs/" + path; + }); return { filesSrc : tests, options : { @@ -232,7 +232,7 @@ module.exports = function(grunt) { }, files: [ // src/index.html should already have been moved by the includereplace task - {src: ['dest/index.html'], dest: 'dest/piskelapp-partials/main-partial.html'} + {src: ['dest-tmp/index.html'], dest: 'dest/piskelapp-partials/main-partial.html'} ] } }, diff --git a/src/js/controller/PalettesListController.js b/src/js/controller/PalettesListController.js index 846e400..af70f65 100644 --- a/src/js/controller/PalettesListController.js +++ b/src/js/controller/PalettesListController.js @@ -51,7 +51,7 @@ var palettes = this.paletteService.getPalettes(); var html = palettes.map(function (palette) { - return pskl.utils.Template.replace('', palette); + return pskl.utils.Template.replace('', palette); }).join(''); this.colorPaletteSelect_.innerHTML = html; }; diff --git a/src/js/controller/dialogs/BrowseLocalController.js b/src/js/controller/dialogs/BrowseLocalController.js index be559f6..adbe1d5 100644 --- a/src/js/controller/dialogs/BrowseLocalController.js +++ b/src/js/controller/dialogs/BrowseLocalController.js @@ -47,7 +47,7 @@ }); keys.forEach((function (key) { - var date = pskl.utils.DateUtils.format(key.date, '{{Y}}/{{M}}/{{D}} {{H}}:{{m}}'); + var date = pskl.utils.DateUtils.format(key.date, '${Y}/${M}/${D} ${H}:${m}'); html += pskl.utils.Template.replace(this.localStorageItemTemplate_, {name : key.name, date : date}); }).bind(this)); diff --git a/src/js/controller/settings/ImportController.js b/src/js/controller/settings/ImportController.js index d144efc..1f06ee6 100644 --- a/src/js/controller/settings/ImportController.js +++ b/src/js/controller/settings/ImportController.js @@ -32,7 +32,7 @@ var previousInfo = pskl.app.backupService.getPreviousPiskelInfo(); if (previousInfo) { var previousSessionTemplate_ = pskl.utils.Template.get('previous-session-info-template'); - var date = pskl.utils.DateUtils.format(previousInfo.date, '{{H}}:{{m}} - {{Y}}/{{M}}/{{D}}'); + var date = pskl.utils.DateUtils.format(previousInfo.date, '${H}:${m} - ${Y}/${M}/${D}'); previousSessionContainer.innerHTML = pskl.utils.Template.replace(previousSessionTemplate_, { name : previousInfo.name, date : date diff --git a/src/js/controller/settings/exportimage/GifExportController.js b/src/js/controller/settings/exportimage/GifExportController.js index 5c46e69..0d697ea 100644 --- a/src/js/controller/settings/exportimage/GifExportController.js +++ b/src/js/controller/settings/exportimage/GifExportController.js @@ -153,7 +153,7 @@ // FIXME : JD : HORRIBLE COPY/PASTA (JD later : where???) ns.GifExportController.prototype.updateStatus_ = function (imageUrl, error) { if (imageUrl) { - var linkTpl = '{{shortLink}}'; + var linkTpl = '${shortLink}'; var linkHtml = pskl.utils.Template.replace(linkTpl, { link : imageUrl, shortLink : this.shorten_(imageUrl, URL_MAX_LENGTH, '...') diff --git a/src/js/controller/settings/exportimage/PngExportController.js b/src/js/controller/settings/exportimage/PngExportController.js index 12ee126..19ace4f 100644 --- a/src/js/controller/settings/exportimage/PngExportController.js +++ b/src/js/controller/settings/exportimage/PngExportController.js @@ -98,7 +98,7 @@ ns.PngExportController.prototype.updateStatus_ = function (imageUrl, error) { if (imageUrl) { - var linkTpl = '{{shortLink}}'; + var linkTpl = '${shortLink}'; var linkHtml = pskl.utils.Template.replace(linkTpl, { link : imageUrl, shortLink : this.shorten_(imageUrl, URL_MAX_LENGTH, '...') diff --git a/src/js/devtools/DrawingTestSuiteController.js b/src/js/devtools/DrawingTestSuiteController.js index 483929b..96ad560 100644 --- a/src/js/devtools/DrawingTestSuiteController.js +++ b/src/js/devtools/DrawingTestSuiteController.js @@ -21,7 +21,7 @@ var testSuiteStatus = document.createElement('li'); testSuiteStatus.innerHTML = pskl.utils.Template.replace( - 'Test Suite [{{path}}]', + 'Test Suite [${path}]', {path : this.shortenPath_(this.suitePath)} ); this.testListElt.appendChild(testSuiteStatus); @@ -51,7 +51,7 @@ var testCaseStatus = document.createElement('li'); testCaseStatus.innerHTML = pskl.utils.Template.replace( - '[{{path}}] finished : {{status}}', + '[${path}] finished : ${status}', {path : this.shortenPath_(testPath), status : status ? 'OK' : 'KO', color : status ? 'green' : 'red'} ); this.testListElt.appendChild(testCaseStatus); @@ -64,7 +64,7 @@ var testSuiteStatus = document.createElement('li'); testSuiteStatus.innerHTML = pskl.utils.Template.replace( - 'Test finished : {{status}} ({{elapsed}} seconds)', + 'Test finished : ${status} (${elapsed} seconds)', {status : status, elapsed : elapsed} ); this.testListElt.appendChild(testSuiteStatus); diff --git a/src/js/service/storage/FileDownloadStorageService.js b/src/js/service/storage/FileDownloadStorageService.js index 87814f1..6ee5aea 100644 --- a/src/js/service/storage/FileDownloadStorageService.js +++ b/src/js/service/storage/FileDownloadStorageService.js @@ -10,7 +10,7 @@ pskl.utils.BlobUtils.stringToBlob(serialized, function(blob) { var piskelName = piskel.getDescriptor().name; - var timestamp = pskl.utils.DateUtils.format(new Date(), '{{Y}}{{M}}{{D}}-{{H}}{{m}}{{s}}'); + var timestamp = pskl.utils.DateUtils.format(new Date(), '${Y}${M}${D}-${H}${m}${s}'); var fileName = piskelName + '-' + timestamp + '.piskel'; try { diff --git a/src/js/utils/Template.js b/src/js/utils/Template.js index ade063b..c5b2e41 100644 --- a/src/js/utils/Template.js +++ b/src/js/utils/Template.js @@ -49,7 +49,7 @@ value = ''; } } - template = template.replace(new RegExp('\\{\\{' + key + '\\}\\}', 'g'), value); + template = template.replace(new RegExp('\\$\\{' + key + '\\}', 'g'), value); } } return template; diff --git a/src/templates/dialogs/browse-local.html b/src/templates/dialogs/browse-local.html index b358253..b6f80ba 100644 --- a/src/templates/dialogs/browse-local.html +++ b/src/templates/dialogs/browse-local.html @@ -21,9 +21,9 @@ \ No newline at end of file diff --git a/src/templates/dialogs/cheatsheet.html b/src/templates/dialogs/cheatsheet.html index bcbec7a..6d2191d 100644 --- a/src/templates/dialogs/cheatsheet.html +++ b/src/templates/dialogs/cheatsheet.html @@ -41,9 +41,9 @@ \ No newline at end of file diff --git a/src/templates/dialogs/create-palette.html b/src/templates/dialogs/create-palette.html index 31f8842..cae390df 100644 --- a/src/templates/dialogs/create-palette.html +++ b/src/templates/dialogs/create-palette.html @@ -75,10 +75,10 @@ \ No newline at end of file diff --git a/src/templates/drawing-tools.html b/src/templates/drawing-tools.html index e50de90..5b29661 100644 --- a/src/templates/drawing-tools.html +++ b/src/templates/drawing-tools.html @@ -35,6 +35,6 @@ \ No newline at end of file diff --git a/src/templates/layers-list.html b/src/templates/layers-list.html index 36b8385..3bc8a82 100644 --- a/src/templates/layers-list.html +++ b/src/templates/layers-list.html @@ -34,6 +34,6 @@ diff --git a/src/templates/misc-templates.html b/src/templates/misc-templates.html index 41fc2c0..a1c0c82 100644 --- a/src/templates/misc-templates.html +++ b/src/templates/misc-templates.html @@ -1,32 +1,32 @@
\ No newline at end of file diff --git a/src/templates/palettes-list.html b/src/templates/palettes-list.html index ef7824b..02fdde2 100644 --- a/src/templates/palettes-list.html +++ b/src/templates/palettes-list.html @@ -11,8 +11,8 @@
diff --git a/src/templates/settings/import.html b/src/templates/settings/import.html index 87c2687..b23ec91 100644 --- a/src/templates/settings/import.html +++ b/src/templates/settings/import.html @@ -45,7 +45,7 @@