Skip to content

Commit

Permalink
support adding inventory on name
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangift committed Aug 17, 2015
1 parent 727bacd commit 4158e58
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@
color: #669;
padding: 9px 8px 0px 8px;
}
table.mainTable td.name span {
cursor: pointer;
text-decoration: underline;
}
table.mainTable td.own span
{
padding-left: 16px;
background-repeat: no-repeat;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAAy0lEQVR42p3TPwtBYRTH8ctllFFKkf9eAKMyYzVZbV6DjcJgY7IpeQcGWawyMCsTZcCEAfk+9QySq3vuqc/y9PzOfTqnaxjOKo4mStKgC0HUdQO/tEEMA/QQkoajmGOCiDScwg5rhKXhDDY4IysNJzHT4ao0HMAYT7RhWl3M/ThTl7u4YaH3blkNdOD7OKvhigMqcP9roFYywgpF/aI7Hhh+NbasNKa44IgXtijYHZh6Yh5LPTT19T68kql7UMYeJySc/GWm3nfLbuANokQkUSA1m0AAAAAASUVORK5CYII=);
}
tbody tr:hover td
{
color: #009;
Expand Down Expand Up @@ -152,6 +162,7 @@
<li>衣柜数据更新到了jillhx的20150817版本,共计:2331,占比95.5%</li>
<li>修正了5-10的权重</li>
<li>增加了云端七夕庙会的权重,然并卵,明天兴许就改题目了呢</li>
<li>为了给下一个功能腾出空间,把拥有栏拆掉放到名字上了,点名字可以直接加入衣柜</li>
</ul>
衣服信息纠错请去<a href="http://tieba.baidu.com/p/3860789814">jillhx的新衣柜楼</a>汇报<br/>
功能错误或者有新需求请去<a href="http://tieba.baidu.com/p/3792563906">主贴</a>汇报<br/>
Expand Down
2 changes: 1 addition & 1 deletion model.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Clothes = function(csv) {
cool = this.cool;
extra = this.tags.join(',');
source = this.source;
return [name, type.type, id, simple[0], simple[1], cute[0], cute[1],
return [type.type, id, simple[0], simple[1], cute[0], cute[1],
active[0], active[1], pure[0], pure[1], cool[0],
cool[1], extra, source];
},
Expand Down
21 changes: 18 additions & 3 deletions nikki.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ var CATEGORY_HIERARCHY = function() {
// for table use
function thead(isShoppingCart, score) {
var ret = "<tr>";
/*
if (!isShoppingCart) {
ret += "<th>拥有</th>";
}
}*/
if (score) {
ret += "<th class='score'>分数</th>";
}
Expand Down Expand Up @@ -88,16 +89,30 @@ function clearShoppingCart() {
}

function toggleInventory(type, id) {
var checked = $('#' + type + id)[0].checked;
var checked = !clothesSet[type][id].own;
clothesSet[type][id].own = checked;
//$('#' + type + id)[0].checked = checked;
$('#clickable-' + type + id).toggleClass('own');
saveAndUpdate();
}

function clickableTd(name, type, id, own) {
return "<td id='clickable-" + (type + id) + "' class='name " + (own ? 'own' : '')
+ "'><span onClick='toggleInventory(\"" + type + "\",\"" + id + "\")'>"
+ name + "</span></td>";
}

function row(piece, isShoppingCart) {
var ret = isShoppingCart ? "" : td(inventoryCheckbox(piece.type.mainType, piece.id, piece.own), "");
//var ret = isShoppingCart ? "" : td(inventoryCheckbox(piece.type.mainType, piece.id, piece.own), "");
var ret = "";
if (!isFilteringMode) {
ret += td(piece.tmpScore);
}
if (isShoppingCart) {
ret += td(piece.name, '');
} else {
ret += clickableTd(piece.name, piece.type.mainType, piece.id, piece.own);
}
var csv = piece.toCsv();
for (var i in csv) {
ret += td(render(csv[i]), getStyle(csv[i]));
Expand Down

0 comments on commit 4158e58

Please sign in to comment.