// Released under the MIT/X11 license // http://www.opensource.org/licenses/mit-license.php "use strict"; function HistoryItem(historyRaw) { // FIXME is this same format as Comment.date ? I.e., // this.date = parseBZCommentDate(timeSpan.textContent.trim()); this.date = 0; } History.prototype.getText = function getText() { return this.element.getElementsByTagName("pre")[0].textContent.trim(); } // FIXME Getter .applied (type Boolean) function HistoryList(raw) { this.formatVersion = raw.version; this.bugs = []; this.faults = []; raw.result.bugs.forEach(function (historyBugItemRaw) { historyBugItemRaw.history.forEach(function (historyRawItem) { var tmpHsItem = new HistoryItem(historyRawItem); if (tmpHsItem) { this.bugs.push(tmpHsItem); } }); }); raw.result.faults.forEach(function (faultItemRaw) { console.log("HistoryList init: fault = " + faultItemRaw.toSource()); }); console.log("HistoryList: this.bugs = " + this.bugs.toSource()); } HistoryList.prototype.forEach = function forEach(fnc) { this.bugs.forEach(fnc); // this is not right // I am not dealing with parameters right, should be // probably some kind of call/apply magic FIXME }; HistoryList.prototype.filter = function filter(fnc) { // Ditto };