From 2cc0e0cffee9e240fe2e49f009089fd691e6bd3b Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Tue, 7 Mar 2017 17:57:40 -0300 Subject: [PATCH] modellist suite et fin --- kfet/static/kfet/js/kfet.api.js | 77 ++- kfet/static/kfet/js/log | 893 ++++++++++++++++++++++++++++++++ 2 files changed, 968 insertions(+), 2 deletions(-) create mode 100644 kfet/static/kfet/js/log diff --git a/kfet/static/kfet/js/kfet.api.js b/kfet/static/kfet/js/kfet.api.js index 3caf3662..0dbc03f2 100644 --- a/kfet/static/kfet/js/kfet.api.js +++ b/kfet/static/kfet/js/kfet.api.js @@ -167,7 +167,17 @@ class ModelObject { */ display($container, options, formatter) { formatter = formatter || this.formatter(); - formatter.render(this, $container, options); + return formatter.render(this, $container, options); + } + + /** + * Compare function between two instances of the model + * @abstract + * @param {a} Models.ModelObject + * @param {b} Models.ModelObject + */ + static compare(a, b) { + return a.id - b.id ; } } @@ -302,8 +312,23 @@ class ModelList { }); } + /** + * Templates used to render the different elements + * @abstract + * @type {string[]} + */ + static get templates() { return []; } + + /** + * Creates empty instance and populates it with data if given + * @param {Object[]} [datalist=[]] + */ + constructor(datalist) { + this.from(datalist || []); + } + /** - * Fetches an object from the object data, or creates it if + * Fetches an object from the instance data, or creates it if * it does not exist yet.
* Parent objects are created recursively if needed. * @param {number} depth depth on the nested structure of the list @@ -361,6 +386,54 @@ class ModelList { this.from([]); } + /** + * Renders an element (and all its offspring) and appends it to the given container. + * Returns the completed container + * @param {jQuery} $container + * @param {Models.ModelObject} elt + * @param {Object} [options] Options for element render method + */ + render_element($container, elt, options) { + var depth = this.names.indexOf(elt.constructor.verbose_name); + + if (depth == -1) { + return $(); + } else if (depth == 0) { + $container.append(elt.display($(this.constructor.templates[0]), options)); + return $container; + } else { + var name = this.constructor.names[depth]; + var child_model = this.constructor.models[depth-1]; + var children = this.data[child_model.verbose_name] + .filter(v => v[name].id == elt.id) ; + children.sort(child_model.compare); + + $container.append(elt.display($(this.constructor.templates[depth]), options)); + + for (let child of children) { + this.render_element($container, child, options); + } + + return $container; + } + } + + /** + * Display stored data in container. + * @param {jQuery} $container + * @param {Object} [options] Options for element render method + */ + display($container, options) { + var root_model = this.constructor.models[this.constructor.models.length-1]; + var roots = this.data[root_model.verbose_name]; + roots.sort(root_model.compare); + + for (let root of roots) { + this.render_element($container, root, options); + } + + return $container; + } } /** diff --git a/kfet/static/kfet/js/log b/kfet/static/kfet/js/log new file mode 100644 index 00000000..83b0b71f --- /dev/null +++ b/kfet/static/kfet/js/log @@ -0,0 +1,893 @@ +kfet.api.js:13: ERROR - Parse error. identifier is a reserved word +class Config { +^ + +kfet.api.js:20: ERROR - Parse error. missing ; before statement + static _get_or_create_config() { + ^ + +kfet.api.js:23: ERROR - Parse error. invalid return + return window.config; + ^ + +kfet.api.js:24: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:31: ERROR - Parse error. missing ; before statement + static reset(callback) { + ^ + +kfet.api.js:32: ERROR - Parse error. syntax error + $.getJSON(Urls['kfet.kpsul.get_settings']()) + ^ + +kfet.api.js:39: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:45: ERROR - Parse error. missing ; before statement + static get(key) { + ^ + +kfet.api.js:47: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:54: ERROR - Parse error. missing ; before statement + static set(key, value) { + ^ + +kfet.api.js:59: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:94: ERROR - Parse error. identifier is a reserved word +class ModelObject { +^ + +kfet.api.js:101: ERROR - Parse error. missing ; before statement + static get props() { return []; } + ^ + +kfet.api.js:101: ERROR - Parse error. syntax error + static get props() { return []; } + ^ + +kfet.api.js:108: ERROR - Parse error. missing ; before statement + static get default_data() { return {}; } + ^ + +kfet.api.js:108: ERROR - Parse error. syntax error + static get default_data() { return {}; } + ^ + +kfet.api.js:115: ERROR - Parse error. missing ; before statement + static get verbose_name() { return ""; } + ^ + +kfet.api.js:115: ERROR - Parse error. syntax error + static get verbose_name() { return ""; } + ^ + +kfet.api.js:121: ERROR - Parse error. missing ; before statement + constructor(data) { + ^ + +kfet.api.js:122: ERROR - Parse error. syntax error + this.from(data || {}); + ^ + +kfet.api.js:123: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:129: ERROR - Parse error. syntax error + is_empty() { + ^ + +kfet.api.js:131: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:138: ERROR - Parse error. syntax error + formatter() { return Formatter; } + ^ + +kfet.api.js:138: ERROR - Parse error. syntax error + formatter() { return Formatter; } + ^ + +kfet.api.js:147: ERROR - Parse error. missing ; before statement + from(data) { + ^ + +kfet.api.js:149: ERROR - Parse error. syntax error + $.extend(this, this.constructor.default_data, data); + ^ + +kfet.api.js:150: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:155: ERROR - Parse error. syntax error + clear() { + ^ + +kfet.api.js:156: ERROR - Parse error. syntax error + this.from({}); + ^ + +kfet.api.js:157: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:168: ERROR - Parse error. missing ; before statement + display($container, options, formatter) { + ^ + +kfet.api.js:169: ERROR - Parse error. syntax error + formatter = formatter || this.formatter(); + ^ + +kfet.api.js:171: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:181: ERROR - Parse error. identifier is a reserved word +class APIModelObject extends ModelObject { +^ + +kfet.api.js:188: ERROR - Parse error. missing ; before statement + static get url_model() {} + ^ + +kfet.api.js:196: ERROR - Parse error. missing ; before statement + static url_object_for(api_pk) {} + ^ + +kfet.api.js:202: ERROR - Parse error. missing ; before statement + constructor(data) { + ^ + +kfet.api.js:207: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:213: ERROR - Parse error. missing ; before statement + get api_pk() { return this.id; } + ^ + +kfet.api.js:213: ERROR - Parse error. syntax error + get api_pk() { return this.id; } + ^ + +kfet.api.js:218: ERROR - Parse error. missing ; before statement + get url_object() { + ^ + +kfet.api.js:220: ERROR - Parse error. invalid return + return this.is_empty() ? '' : this.constructor.url_object_for(this.api_pk); + ^ + +kfet.api.js:221: ERROR - Parse error. invalid return + return this._url_object; + ^ + +kfet.api.js:222: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:224: ERROR - Parse error. missing ; before statement + set url_object(v) { this._url_object = v; } + ^ + +kfet.api.js:224: ERROR - Parse error. syntax error + set url_object(v) { this._url_object = v; } + ^ + +kfet.api.js:233: ERROR - Parse error. missing ; before statement + fromAPI(api_options, on_success, on_error) { + ^ + +kfet.api.js:248: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:258: ERROR - Parse error. missing ; before statement + get_by_apipk(api_pk, api_options, on_success, on_error) { + ^ + +kfet.api.js:259: ERROR - Parse error. syntax error + this.url_object = this.constructor.url_object_for(api_pk); + ^ + +kfet.api.js:261: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:270: ERROR - Parse error. missing ; before statement + display($container, options, formatter) { + ^ + +kfet.api.js:271: ERROR - Parse error. missing ; before statement + if (this.is_empty()) { + ^ + +kfet.api.js:272: ERROR - Parse error. syntax error + options.empty_props = true; + ^ + +kfet.api.js:274: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:276: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:285: ERROR - Parse error. identifier is a reserved word +class ModelList { +^ + +kfet.api.js:292: ERROR - Parse error. missing ; before statement + static get models() { return []; } + ^ + +kfet.api.js:292: ERROR - Parse error. syntax error + static get models() { return []; } + ^ + +kfet.api.js:299: ERROR - Parse error. missing ; before statement + static get names() { + ^ + +kfet.api.js:303: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:305: ERROR - Parse error. missing ; before statement + constructor(data) { + ^ + +kfet.api.js:306: ERROR - Parse error. syntax error + this.from(data || []); + ^ + +kfet.api.js:307: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:316: ERROR - Parse error. missing ; before statement + get_or_create(depth, data) { + ^ + +kfet.api.js:325: ERROR - Parse error. invalid return + return existing; + ^ + +kfet.api.js:330: ERROR - Parse error. invalid return + return created ; + ^ + +kfet.api.js:341: ERROR - Parse error. invalid return + return created ; + ^ + +kfet.api.js:343: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:350: ERROR - Parse error. missing ; before statement + from(datalist) { + ^ + +kfet.api.js:352: ERROR - Parse error. missing ) in parenthetical + for (let key of this.constructor.names) { + ^ + +kfet.api.js:353: ERROR - Parse error. syntax error + this.data[key] = []; + ^ + +kfet.api.js:354: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:356: ERROR - Parse error. missing ) in parenthetical + for (let data of datalist) { + ^ + +kfet.api.js:357: ERROR - Parse error. syntax error + this.get_or_create(data, 0); + ^ + +kfet.api.js:358: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:364: ERROR - Parse error. missing ; before statement + clear() { + ^ + +kfet.api.js:365: ERROR - Parse error. syntax error + this.from([]); + ^ + +kfet.api.js:366: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:375: ERROR - Parse error. identifier is a reserved word +class Account extends APIModelObject { +^ + +kfet.api.js:383: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:386: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:395: ERROR - Parse error. missing ; before statement + static get default_data() { + ^ + +kfet.api.js:397: ERROR - Parse error. missing ; before statement + 'id': 0, 'trigramme': '', 'name': '', 'nickname': '', 'email': '', + ^ + +kfet.api.js:398: ERROR - Parse error. syntax error + 'is_cof' : false, 'promo': '', 'balance': 0, 'is_frozen': false, + ^ + +kfet.api.js:399: ERROR - Parse error. syntax error + 'departement': '', + ^ + +kfet.api.js:407: ERROR - Parse error. identifier is a reserved word + static get url_model() { return Urls['kfet.account'](); } + ^ + +kfet.api.js:407: ERROR - Parse error. syntax error + static get url_model() { return Urls['kfet.account'](); } + ^ + +kfet.api.js:414: ERROR - Parse error. missing ; before statement + static url_object_for(trigramme) { + ^ + +kfet.api.js:416: ERROR - Parse error. invalid return + return Urls['kfet.account.read'](trigramme_url); + ^ + +kfet.api.js:417: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:422: ERROR - Parse error. missing ; before statement + get api_pk() { return this.trigramme; } + ^ + +kfet.api.js:422: ERROR - Parse error. syntax error + get api_pk() { return this.trigramme; } + ^ + +kfet.api.js:427: ERROR - Parse error. syntax error + formatter() { + ^ + +kfet.api.js:429: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:433: ERROR - Parse error. missing ; before statement + get balance() { return this._balance; } + ^ + +kfet.api.js:433: ERROR - Parse error. syntax error + get balance() { return this._balance; } + ^ + +kfet.api.js:434: ERROR - Parse error. missing ; before statement + set balance(v) { return this._balance = floatCheck(v); } + ^ + +kfet.api.js:434: ERROR - Parse error. syntax error + set balance(v) { return this._balance = floatCheck(v); } + ^ + +kfet.api.js:439: ERROR - Parse error. missing ; before statement + get balance_ukf() { return amountToUKF(this.balance, this.is_cof); } + ^ + +kfet.api.js:439: ERROR - Parse error. syntax error + get balance_ukf() { return amountToUKF(this.balance, this.is_cof); } + ^ + +kfet.api.js:449: ERROR - Parse error. identifier is a reserved word +class Checkout extends APIModelObject { +^ + +kfet.api.js:456: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:458: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:466: ERROR - Parse error. missing ; before statement + static get default_data() { + ^ + +kfet.api.js:468: ERROR - Parse error. missing ; before statement + 'id': 0, 'name': '', 'balance': 0, 'valid_from': '', 'valid_to': '', + ^ + +kfet.api.js:476: ERROR - Parse error. identifier is a reserved word + static get url_model() { return ''; } + ^ + +kfet.api.js:476: ERROR - Parse error. syntax error + static get url_model() { return ''; } + ^ + +kfet.api.js:483: ERROR - Parse error. missing ; before statement + static url_object_for(api_pk) { + ^ + +kfet.api.js:485: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:490: ERROR - Parse error. syntax error + formatter() { + ^ + +kfet.api.js:492: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:496: ERROR - Parse error. missing ; before statement + get balance() { return this._balance; } + ^ + +kfet.api.js:496: ERROR - Parse error. syntax error + get balance() { return this._balance; } + ^ + +kfet.api.js:497: ERROR - Parse error. missing ; before statement + set balance(v) { this._balance = floatCheck(v); } + ^ + +kfet.api.js:497: ERROR - Parse error. syntax error + set balance(v) { this._balance = floatCheck(v); } + ^ + +kfet.api.js:507: ERROR - Parse error. identifier is a reserved word +class Statement extends ModelObject { +^ + +kfet.api.js:514: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:516: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:524: ERROR - Parse error. missing ; before statement + static get default_data() { + ^ + +kfet.api.js:526: ERROR - Parse error. missing ; before statement + 'id': 0, 'at': '', 'balance_old': 0, 'balance_new': 0, 'by': '', + ^ + +kfet.api.js:533: ERROR - Parse error. missing ; before statement + formatter() { + ^ + +kfet.api.js:535: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:539: ERROR - Parse error. missing ; before statement + get balance_old() { return this._balance_old; } + ^ + +kfet.api.js:539: ERROR - Parse error. syntax error + get balance_old() { return this._balance_old; } + ^ + +kfet.api.js:540: ERROR - Parse error. missing ; before statement + set balance_old(v) { this._balance_old = floatCheck(v); } + ^ + +kfet.api.js:540: ERROR - Parse error. syntax error + set balance_old(v) { this._balance_old = floatCheck(v); } + ^ + +kfet.api.js:542: ERROR - Parse error. missing ; before statement + get balance_new() { return this._balance_new; } + ^ + +kfet.api.js:542: ERROR - Parse error. syntax error + get balance_new() { return this._balance_new; } + ^ + +kfet.api.js:543: ERROR - Parse error. missing ; before statement + set balance_new(v) { this._balance_new = floatCheck(v); } + ^ + +kfet.api.js:543: ERROR - Parse error. syntax error + set balance_new(v) { this._balance_new = floatCheck(v); } + ^ + +kfet.api.js:545: ERROR - Parse error. missing ; before statement + get at() { return this._at; } + ^ + +kfet.api.js:545: ERROR - Parse error. syntax error + get at() { return this._at; } + ^ + +kfet.api.js:546: ERROR - Parse error. missing ; before statement + set at(v) { this._at = moment.isMoment(v) ? v : moment.tz(v, 'UTC'); } + ^ + +kfet.api.js:546: ERROR - Parse error. syntax error + set at(v) { this._at = moment.isMoment(v) ? v : moment.tz(v, 'UTC'); } + ^ + +kfet.api.js:555: ERROR - Parse error. identifier is a reserved word +class ArticleCategory extends ModelObject { +^ + +kfet.api.js:562: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:564: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:571: ERROR - Parse error. missing ; before statement + static get default_data() { + ^ + +kfet.api.js:572: ERROR - Parse error. missing ; before statement + return {'id': 0, 'name': ''}; + ^ + +kfet.api.js:578: ERROR - Parse error. missing ; before statement + formatter() { + ^ + +kfet.api.js:580: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:588: ERROR - Parse error. identifier is a reserved word +class Article extends ModelObject { +^ + +kfet.api.js:594: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:596: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:604: ERROR - Parse error. missing ; before statement + static get default_data() { + ^ + +kfet.api.js:606: ERROR - Parse error. missing ; before statement + 'id': 0, 'name': '', 'price': 0, 'stock': 0, + ^ + +kfet.api.js:607: ERROR - Parse error. syntax error + 'category': new ArticleCategory(), + ^ + +kfet.api.js:614: ERROR - Parse error. missing ; before statement + formatter() { + ^ + +kfet.api.js:616: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:620: ERROR - Parse error. missing ; before statement + get price() { return this._price; } + ^ + +kfet.api.js:620: ERROR - Parse error. syntax error + get price() { return this._price; } + ^ + +kfet.api.js:621: ERROR - Parse error. missing ; before statement + set price(v) { this._price = floatCheck(v); } + ^ + +kfet.api.js:621: ERROR - Parse error. syntax error + set price(v) { this._price = floatCheck(v); } + ^ + +kfet.api.js:640: ERROR - Parse error. identifier is a reserved word +class Formatter { +^ + +kfet.api.js:642: ERROR - Parse error. missing ; before statement + static get props() { return []; } + ^ + +kfet.api.js:642: ERROR - Parse error. syntax error + static get props() { return []; } + ^ + +kfet.api.js:643: ERROR - Parse error. missing ; before statement + static get attrs() { return []; } + ^ + +kfet.api.js:643: ERROR - Parse error. syntax error + static get attrs() { return []; } + ^ + +kfet.api.js:653: ERROR - Parse error. missing ; before statement + static get(object, name, prefix) { + ^ + +kfet.api.js:654: ERROR - Parse error. syntax error + prefix = prefix || ''; + ^ + +kfet.api.js:657: ERROR - Parse error. invalid return + return this[method](object); + ^ + +kfet.api.js:658: ERROR - Parse error. invalid return + return object[name]; + ^ + +kfet.api.js:659: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:665: ERROR - Parse error. missing ; before statement + static get_prop(object, name) { + ^ + +kfet.api.js:667: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:673: ERROR - Parse error. missing ; before statement + static get_attr(obj, attr) { + ^ + +kfet.api.js:675: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:689: ERROR - Parse error. missing ; before statement + static render(object, $container, options) { + ^ + +kfet.api.js:690: ERROR - Parse error. syntax error + options.props = options.props || []; + ^ + +kfet.api.js:711: ERROR - Parse error. invalid return + return $container; + ^ + +kfet.api.js:712: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:721: ERROR - Parse error. identifier is a reserved word +class AccountFormatter extends Formatter { +^ + +kfet.api.js:727: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:729: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:735: ERROR - Parse error. missing ; before statement + static get attrs() { + ^ + +kfet.api.js:737: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:739: ERROR - Parse error. missing ; before statement + static get _data_balance() { + ^ + +kfet.api.js:741: ERROR - Parse error. missing ; before statement + 'default': '', 'frozen': 'frozen', + ^ + +kfet.api.js:742: ERROR - Parse error. syntax error + 'ok': 'ok', 'low': 'low', 'neg': 'neg', + ^ + +kfet.api.js:749: ERROR - Parse error. identifier is a reserved word + static prop_balance(a) { + ^ + +kfet.api.js:751: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:756: ERROR - Parse error. missing ; before statement + static prop_is_cof(a) { + ^ + +kfet.api.js:758: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:764: ERROR - Parse error. missing ; before statement + static attr_data_balance(a) { + ^ + +kfet.api.js:765: ERROR - Parse error. missing ; before statement + if (a.is_frozen) { return this._data_balance.frozen; } + ^ + +kfet.api.js:765: ERROR - Parse error. syntax error + if (a.is_frozen) { return this._data_balance.frozen; } + ^ + +kfet.api.js:766: ERROR - Parse error. invalid return + else if (a.balance >= 5) { return this._data_balance.ok; } + ^ + +kfet.api.js:767: ERROR - Parse error. invalid return + else if (a.balance >= 0) { return this._data_balance.low; } + ^ + +kfet.api.js:768: ERROR - Parse error. invalid return + else /* a.balance < 0 */ { return this._data_balance.neg; } + ^ + +kfet.api.js:769: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:778: ERROR - Parse error. identifier is a reserved word +class LIQFormatter extends AccountFormatter { +^ + +kfet.api.js:784: ERROR - Parse error. missing ; before statement + static get_prop() { + ^ + +kfet.api.js:786: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:791: ERROR - Parse error. missing ; before statement + static attr_data_balance(a) { return this._data_balance.ok; } + ^ + +kfet.api.js:791: ERROR - Parse error. syntax error + static attr_data_balance(a) { return this._data_balance.ok; } + ^ + +kfet.api.js:800: ERROR - Parse error. identifier is a reserved word +class CheckoutFormatter extends Formatter { +^ + +kfet.api.js:806: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:808: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:813: ERROR - Parse error. missing ; before statement + static prop_balance(c) { + ^ + +kfet.api.js:815: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:825: ERROR - Parse error. identifier is a reserved word +class StatementFormatter extends Formatter { +^ + +kfet.api.js:831: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:833: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:838: ERROR - Parse error. missing ; before statement + static prop_balance_old(s) { + ^ + +kfet.api.js:840: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:845: ERROR - Parse error. missing ; before statement + static prop_balance_new(s) { + ^ + +kfet.api.js:847: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:852: ERROR - Parse error. missing ; before statement + static prop_at(s) { + ^ + +kfet.api.js:854: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:864: ERROR - Parse error. identifier is a reserved word +class ArticleCategoryFormatter extends Formatter { +^ + +kfet.api.js:870: ERROR - Parse error. missing ; before statement + static get props() { + ^ + +kfet.api.js:872: ERROR - Parse error. syntax error + } + ^ + +kfet.api.js:874: ERROR - Parse error. missing ; before statement + static get _data_stock() { + ^ + +kfet.api.js:876: ERROR - Parse error. missing ; before statement + 'default': '', 'low': 'low', + ^ + +kfet.api.js:877: ERROR - Parse error. syntax error + 'ok': 'ok', 'neg': 'neg', + ^ + +kfet.api.js:881: ERROR - Parse error. identifier is a reserved word + static attr_data_stock(a) { + ^ + +kfet.api.js:882: ERROR - Parse error. missing ; before statement + if (a.stock >= 5) { return this._data_stock.ok; } + ^ + +kfet.api.js:882: ERROR - Parse error. syntax error + if (a.stock >= 5) { return this._data_stock.ok; } + ^ + +kfet.api.js:883: ERROR - Parse error. invalid return + else if (a.stock >= -5) { return this._data_stock.low; } + ^ + +kfet.api.js:884: ERROR - Parse error. invalid return + else /* a.stock < -5 */ { return this._data_stock.neg; } + ^ + +kfet.api.js:885: ERROR - Parse error. syntax error + } + ^ + +223 error(s), 0 warning(s)