From 4158e58bd2418fff2d6a5d5b15bd288e125b6bdc Mon Sep 17 00:00:00 2001 From: Yifan Chen Date: Tue, 18 Aug 2015 01:59:15 +0800 Subject: [PATCH] support adding inventory on name --- index.html | 11 +++++++++++ model.js | 2 +- nikki.js | 21 ++++++++++++++++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 051f9f3..27866ed 100644 --- a/index.html +++ b/index.html @@ -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; @@ -152,6 +162,7 @@
  • 衣柜数据更新到了jillhx的20150817版本,共计:2331,占比95.5%
  • 修正了5-10的权重
  • 增加了云端七夕庙会的权重,然并卵,明天兴许就改题目了呢
  • +
  • 为了给下一个功能腾出空间,把拥有栏拆掉放到名字上了,点名字可以直接加入衣柜
  • 衣服信息纠错请去jillhx的新衣柜楼汇报
    功能错误或者有新需求请去主贴汇报
    diff --git a/model.js b/model.js index b4e3612..7043fef 100644 --- a/model.js +++ b/model.js @@ -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]; }, diff --git a/nikki.js b/nikki.js index 63e32c6..3d8db6f 100644 --- a/nikki.js +++ b/nikki.js @@ -15,9 +15,10 @@ var CATEGORY_HIERARCHY = function() { // for table use function thead(isShoppingCart, score) { var ret = ""; + /* if (!isShoppingCart) { ret += "拥有"; - } + }*/ if (score) { ret += "分数"; } @@ -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 "" + + name + ""; +} + 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]));