Skip to content

Commit

Permalink
2.1.0 preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Aug 30, 2016
1 parent 031f3de commit d7fa0da
Show file tree
Hide file tree
Showing 12 changed files with 1,077 additions and 1,025 deletions.
2 changes: 0 additions & 2 deletions dist/cli/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var Builder = function Builder(root, folder, dest, flow) {
_.Util.getDataList(_.fileUtils.removeLast(json.abe_meta.link), text, json).then(function () {
var page = new _.Page(json.abe_meta.link, text, json, true);
(0, _Save.saveHtml)(_.fileUtils.concatPath(root, dest + json.abe_meta.link), page.html);
console.log(_.fileUtils.concatPath(root, dest + json.abe_meta.link));
if (files[index + 1]) build(index + 1);
}).catch(function (e) {
console.error(e);
Expand All @@ -55,7 +54,6 @@ var Builder = function Builder(root, folder, dest, flow) {
_.Util.getDataList(_.fileUtils.removeLast(json.abe_meta.link), text, json).then(function () {
var page = new _.Page(json.abe_meta.link, text, json, true);
(0, _Save.saveHtml)(_.fileUtils.concatPath(root, dest + json.abe_meta.link), page.html);
console.log(_.fileUtils.concatPath(root, dest + json.abe_meta.link));
if (files[index + 1]) build(index + 1);
}).catch(function (e) {
console.error(e);
Expand Down
6 changes: 2 additions & 4 deletions dist/cli/controllers/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* Page class
* manage HTML generation for page template
*/

var Page = function () {

/**
Expand All @@ -57,7 +56,6 @@ var Page = function () {
* @param {Boolean} onlyHTML default = false, if true HTML content will contains abe attributs
* @return {String} HTML page as string
*/

function Page(path, text, json) {
var _this = this;

Expand All @@ -77,8 +75,8 @@ var Page = function () {
_handlebars2.default.registerHelper('i18nAbe', _.translate); // HandlebarsJS unique text helper
_handlebars2.default.registerHelper('math', _.math); // HandlebarsJS unique text helper
_handlebars2.default.registerHelper('moduloIf', _.moduloIf); // HandlebarsJS helper for modulo test
_handlebars2.default.registerHelper('testObj', _.testObj); //
_handlebars2.default.registerHelper('attrAbe', _.attrAbe); //
_handlebars2.default.registerHelper('testObj', _.testObj); //
_handlebars2.default.registerHelper('attrAbe', _.attrAbe); //
_handlebars2.default.registerHelper('printJson', _.printJson);
_handlebars2.default.registerHelper('printBlock', _.printBlock);
_handlebars2.default.registerHelper('className', _.className);
Expand Down
15 changes: 11 additions & 4 deletions dist/cli/handlebars/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sourceOption = exports.sourceAutocomplete = exports.sourceAttr = exports.recursivePrintConfig = exports.recursiveFolder = exports.printInput = exports.printConfig = exports.printBlock = exports.listPage = exports.folders = exports.compileAbe = exports.abeImport = exports.abeEngine = exports.times = exports.translate = exports.testObj = exports.printJson = exports.notEmpty = exports.moduloIf = exports.math = exports.ifIn = exports.ifCond = exports.cleanTab = exports.className = exports.attrAbe = undefined;
exports.sourceOption = exports.sourceAutocomplete = exports.sourceAttr = exports.recursivePrintConfig = exports.recursiveFolder = exports.printInput = exports.printConfig = exports.printBlock = exports.listPage = exports.folders = exports.compileAbe = exports.abeImport = exports.abeEngine = exports.times = exports.translate = exports.testObj = exports.printJson = exports.notEmpty = exports.moduloIf = exports.math = exports.truncate = exports.isTrue = exports.ifIn = exports.ifCond = exports.cleanTab = exports.className = exports.attrAbe = undefined;

var _handlebars = require('handlebars');

Expand Down Expand Up @@ -73,6 +73,10 @@ var _times = require('./utils/times');

var _times2 = _interopRequireDefault(_times);

var _truncate = require('./utils/truncate');

var _truncate2 = _interopRequireDefault(_truncate);

var _abeEngine = require('./abe/abeEngine');

var _abeEngine2 = _interopRequireDefault(_abeEngine);
Expand Down Expand Up @@ -128,13 +132,13 @@ var _sourceOption2 = _interopRequireDefault(_sourceOption);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* Register utilities */


/* Handlebar utilities */
_handlebars2.default.registerHelper('attrAbe', _attrAbe2.default);

/* Handlebar abe */


/* Handlebar utilities */

_handlebars2.default.registerHelper('className', _className2.default);
_handlebars2.default.registerHelper('cleanTab', _cleanTab2.default);
_handlebars2.default.registerHelper('slugify', (0, _handlebarsHelperSlugify2.default)({ Handlebars: _handlebars2.default }).slugify);
Expand All @@ -148,6 +152,7 @@ _handlebars2.default.registerHelper('printJson', _printJson2.default);
_handlebars2.default.registerHelper('testObj', _testObj2.default);
_handlebars2.default.registerHelper('i18nAbe', _translate2.default);
_handlebars2.default.registerHelper('times', _times2.default);
_handlebars2.default.registerHelper('truncate', _truncate2.default);

/* Register abe */
_handlebars2.default.registerHelper('abeImport', _abeImport2.default);
Expand All @@ -165,6 +170,8 @@ exports.className = _className2.default;
exports.cleanTab = _cleanTab2.default;
exports.ifCond = _ifCond2.default;
exports.ifIn = _ifIn2.default;
exports.isTrue = _isTrue2.default;
exports.truncate = _truncate2.default;
exports.math = _math2.default;
exports.moduloIf = _moduloIf2.default;
exports.notEmpty = _notEmpty2.default;
Expand Down
26 changes: 26 additions & 0 deletions dist/cli/handlebars/utils/truncate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = truncate;

var _handlebars = require("handlebars");

var _handlebars2 = _interopRequireDefault(_handlebars);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function truncate(str, len) {
if (str && str.length > len) {
new_str = new _handlebars2.default.SafeString(str);
var new_str = str + " ";
new_str = str.substr(0, len);
new_str = str.substr(0, new_str.lastIndexOf(" "));
new_str = new_str.length > 0 ? new_str : str.substr(0, len);

return new_str + '...';
}

return new _handlebars2.default.SafeString(str);
}
1 change: 0 additions & 1 deletion dist/cli/helpers/file-attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ var Attr = function () {
* @param {String} str string to work with
* @return {void}
*/

function Attr(str) {
_classCallCheck(this, Attr);

Expand Down
1 change: 0 additions & 1 deletion dist/hooks/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
var keys = [];
var hooks = {
/***************** express *****************/
beforeExpress: function beforeExpress(port, abe) {
Expand Down
3 changes: 1 addition & 2 deletions dist/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ if (_cli.config.security === true) {
sandbox: ['allow-same-origin', 'allow-scripts', "allow-modals", 'allow-popups', 'allow-forms'],
reportUri: '/report-violation',
objectSrc: [] },
// An empty array allows nothing through
reportOnly: false, // Set to true if you only want browsers to report errors, not block them
setAllHeaders: false, // Set to true if you want to blindly set all headers: Content-Security-Policy, X-WebKit-CSP, and X-Content-Security-Policy.
disableAndroid: false, // Set to true if you want to disable CSP on Android where it can be buggy.
disableAndroid: false, // Set to true if you want to disable CSP on Android where it can be buggy.
browserSniff: true // Set to false if you want to completely disable any user-agent sniffing. This may make the headers less compatible but it will be much faster. This defaults to `true`.
}));
}
Expand Down
2 changes: 1 addition & 1 deletion dist/server/public/libs/bootstrap.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requir
c = this.options;return a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title);
}, c.prototype.getUID = function (a) {
do {
a += ~ ~(1e6 * Math.random());
a += ~~(1e6 * Math.random());
} while (document.getElementById(a));return a;
}, c.prototype.tip = function () {
if (!this.$tip && (this.$tip = a(this.options.template), 1 != this.$tip.length)) throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!");return this.$tip;
Expand Down
2 changes: 1 addition & 1 deletion dist/server/public/libs/jquery-2.1.0.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c)));
}return e ? a : j ? b.call(a) : i ? b(a[0], c) : f;
};o.acceptData = function (a) {
return 1 === a.nodeType || 9 === a.nodeType || ! +a.nodeType;
return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType;
};function K() {
Object.defineProperty(this.cache = {}, 0, { get: function get() {
return {};
Expand Down
Loading

0 comments on commit d7fa0da

Please sign in to comment.