Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Port to YUI 3.5.0.

  • Loading branch information...
commit 5c6e53683c2d8c84a85cae498daeac191b71961c 1 parent c23bbc4
@albertosantini authored
View
5 HISTORY.markdown
@@ -1,3 +1,8 @@
+1.2.0 / 2012-04-13
+==================
+
+* Updated to YUI 3.5.0 and finance 1.2.12.
+
1.1.8 / 2011-11-20
==================
View
4 lib/public/ConPA/ConPA.html
@@ -11,7 +11,7 @@
<meta name="keywords" content="PROPlus, ConPA, advisory">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.9.0/build/reset-fonts-grids/reset-fonts-grids.css&2.9.0/build/base/base-min.css&2.9.0/build/assets/skins/sam/skin.css">
- <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.4.1/build/widget-base/assets/skins/sam/widget-base.css&3.4.1/build/tabview/assets/skins/sam/tabview.css&3.4.1/build/autocomplete-list/assets/skins/sam/autocomplete-list.css&3.4.1/build/datatable-base/assets/skins/sam/datatable-base.css&3.4.1/build/widget-stack/assets/skins/sam/widget-stack.css">
+ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.5.0/build/widget-base/assets/skins/sam/widget-base.css&3.5.0/build/tabview/assets/skins/sam/tabview.css&3.5.0/build/autocomplete-list/assets/skins/sam/autocomplete-list.css&3.5.0/build/datatable-base/assets/skins/sam/datatable-base.css&3.5.0/build/widget-stack/assets/skins/sam/widget-stack.css">
<link rel="stylesheet" type="text/css" href="css/ConPA.css">
</head>
@@ -114,7 +114,7 @@
</div>
-<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
+<script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js"></script>
<script src="js/ConPA.js"></script>
</body>
View
76 lib/public/ConPA/js/ConPA.js
@@ -1232,15 +1232,15 @@ YUI({
function hyphenFormatter(o) {
var assets, weights, lowBounds, highBounds, n, i, title;
- title = o.record.getValue('id') + " \n" +
- "perf: " + percentage(o.record.getValue('value.perf')) + " " +
- "risk: " + percentage(o.record.getValue('value.risk')) + " " +
- "ret: " + percentage(o.record.getValue('value.ret')) + " \n" +
- "reference date: " + o.record.getValue('value.ref') + " \n";
- assets = o.record.getValue('value.assets');
- weights = o.record.getValue('value.weights');
- lowBounds = o.record.getValue('value.constraints.lowBounds');
- highBounds = o.record.getValue('value.constraints.highBounds');
+ title = o.record.get('id') + " \n" +
+ "perf: " + percentage(o.record.get('perf')) + " " +
+ "risk: " + percentage(o.record.get('risk')) + " " +
+ "ret: " + percentage(o.record.get('ret')) + " \n" +
+ "reference date: " + o.record.get('ref') + " \n";
+ assets = o.record.get('assets');
+ weights = o.record.get('weights');
+ lowBounds = o.record.get('lows');
+ highBounds = o.record.get('highs');
n = assets.length;
for (i = 0; i < n; i += 1) {
title += assets[i] + " " + percentage(weights[i]);
@@ -1254,8 +1254,8 @@ YUI({
title += " \n";
}
- this.tdTemplate = '<td title="{title}" headers="{headers}" class="{classnames}"><div class="yui3-datatable-liner">{value}</div></td>';
- o.title = title;
+ o.column.cellTemplate = '<td title="' + title +
+ '" {headers} class="{className}">{content}</td>';
return o.value.substr(0, 5) + "..." +
o.value.substr(o.value.length - 5, 5);
@@ -1271,31 +1271,31 @@ YUI({
schema: {
resultListLocator: "rows",
resultFields: ["key", "id",
- {key: "value.created_at"},
- {key: "value.assets"},
- {key: "value.weights"},
- {key: "value.ref"},
- {key: "value.ret"},
- {key: "value.risk"},
- {key: "value.perf"},
- {key: "value.constraints.lowBounds"},
- {key: "value.constraints.highBounds"}
+ {key: "created_at", locator: "value.created_at"},
+ {key: "assets", locator: "value.assets"},
+ {key: "weights", locator: "value.weights"},
+ {key: "ref", locator: "value.ref"},
+ {key: "ret", locator: "value.ret"},
+ {key: "risk", locator: "value.risk"},
+ {key: "perf", locator: "value.perf"},
+ {key: "lows", locator: "value.constraints.lowBounds"},
+ {key: "highs", locator: "value.constraints.highBounds"}
]
}
});
- lastPtfsDT = new Y.DataTable.Base({columnset: [
+ lastPtfsDT = new Y.DataTable({columns: [
{ key: "key", label: "To Date" },
- { key: "value.ref", label: "Reference Date" },
+ { key: "ref", label: "Reference Date" },
{ key: "id", label: "Last Created", formatter: hyphenFormatter
},
- { key: "value.perf", label: "Perf",
+ { key: "perf", label: "Perf",
formatter: percentageFormatter, width: 75
},
- { key: "value.risk", label: "Risk",
+ { key: "risk", label: "Risk",
formatter: percentageFormatter, width: 75
},
- { key: "value.ret", label: "Ret",
+ { key: "ret", label: "Ret",
formatter: percentageFormatter, width: 75
}
]}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
@@ -1306,35 +1306,35 @@ YUI({
{ key: "key", label: keyName,
formatter: percentageFormatter, width: 50
},
- { key: "value.created_at", label: "To Date" },
+ { key: "created_at", label: "To Date" },
{ key: "id", label: idDesc, formatter: hyphenFormatter }
];
}
- bestPerfDT = new Y.DataTable.Base({
- columnset: getDefs("Perf", "Best Performing")
+ bestPerfDT = new Y.DataTable({
+ columns: getDefs("Perf", "Best Performing")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#bestPerformingPortfolios");
- worstPerfDT = new Y.DataTable.Base({
- columnset: getDefs("Perf", "Worst Performing")
+ worstPerfDT = new Y.DataTable({
+ columns: getDefs("Perf", "Worst Performing")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#worstPerformingPortfolios");
- highRiskDT = new Y.DataTable.Base({
- columnset: getDefs("Risk", "High Profile Risk")
+ highRiskDT = new Y.DataTable({
+ columns: getDefs("Risk", "High Profile Risk")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#highProfileRiskPortfolios");
- lowRiskDT = new Y.DataTable.Base({
- columnset: getDefs("Risk", "Low Profile Risk")
+ lowRiskDT = new Y.DataTable({
+ columns: getDefs("Risk", "Low Profile Risk")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#lowProfileRiskPortfolios");
- highRetDT = new Y.DataTable.Base({
- columnset: getDefs("Ret", "High Profile Return")
+ highRetDT = new Y.DataTable({
+ columns: getDefs("Ret", "High Profile Return")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#highProfileReturnPortfolios");
- lowRetDT = new Y.DataTable.Base({
- columnset: getDefs("Ret", "Low Profile Return")
+ lowRetDT = new Y.DataTable({
+ columns: getDefs("Ret", "Low Profile Return")
}).plug(Y.Plugin.DataTableDataSource, {datasource: ptfDS})
.render("#lowProfileReturnPortfolios");
View
4 package.json
@@ -1,7 +1,7 @@
{
"name" : "conpa",
"description" : "Asset allocation application",
- "version" : "1.1.8",
+ "version" : "1.2.0",
"main" : "index",
"repository" : "http://github.com/albertosantini/node-conpa",
"keywords": ["finance", "asset allocation", "optimization"],
@@ -14,7 +14,7 @@
],
"engines" : { "node" : ">=0.4.x" },
"dependencies" : {
- "finance" : ">=1.2.11"
+ "finance" : ">=1.2.12"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.