Commit 766ef811 authored by Łukasz Nowak's avatar Łukasz Nowak

Continue category switcher.

Add base (dirty for now hooks) CSS classes.

Start hash manipulation on category selection.
parent 610c8dbd
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts22660122.87</string> </value> <value> <string>ts22663064.44</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -102,24 +102,28 @@ function toggle() {\n ...@@ -102,24 +102,28 @@ function toggle() {\n
\n \n
function hasher() {\n function hasher() {\n
t = $(this)[0].id.replace(\'_\', \' \', \'g\');\n t = $(this)[0].id.replace(\'_\', \' \', \'g\');\n
console.log(\'Would set \' + t)\n query_kw = $.deparam.fragment();\n
// window.location.hash = \'oink=\' + t;\n query_kw[\'software_category\'] = t;\n
$(\'.selected\').removeClass(\'selected\');\n window.location.hash = \'#\'+$.param(query_kw);\n
$(this).addClass(\'selected\');\n $(\'.software_category_selected\').removeClass(\'software_category_selected\');\n
$(this).addClass(\'software_category_selected\');\n
}\n }\n
\n \n
function resetCategoryHash() {\n function resetCategoryHash() {\n
console.log(\'Reseted\');\n $(\'.software_category_selected\').removeClass(\'software_category_selected\');\n
query_kw = $.deparam.fragment();\n
query_kw[\'software_category\'] = \'\';\n
window.location.hash = \'#\'+$.param(query_kw);\n
}\n }\n
\n \n
function appendSoftwareCategoryTree(data, id) {\n function appendSoftwareCategoryTree(data, id) {\n
console.log(id);\n
console.log(data);\n
var ul = $(\'<ul>\');\n var ul = $(\'<ul>\');\n
ul.addClass(\'software_category\');\n
if (id !== undefined) {ul.attr(\'id\', id.replace(\' \', \'_\', \'g\'));}\n if (id !== undefined) {ul.attr(\'id\', id.replace(\' \', \'_\', \'g\'));}\n
else {\n else {\n
ul.attr(\'id\', \'master\');\n ul.attr(\'id\', \'master\');\n
var reset = $(\'<li>\');\n var reset = $(\'<li>\');\n
reset.addClass(\'software_category\');\n
reset.text(\'Reset...\')\n reset.text(\'Reset...\')\n
reset.click(resetCategoryHash);\n reset.click(resetCategoryHash);\n
ul.append(reset);\n ul.append(reset);\n
...@@ -127,6 +131,7 @@ function appendSoftwareCategoryTree(data, id) {\n ...@@ -127,6 +131,7 @@ function appendSoftwareCategoryTree(data, id) {\n
var i = 0;\n var i = 0;\n
for (var q in data) {\n for (var q in data) {\n
var li = $(\'<li>\');\n var li = $(\'<li>\');\n
li.addClass(\'software_category\');\n
li.attr({\'id\': q.replace(\' \', \'_\', \'g\'), \'t\': q});\n li.attr({\'id\': q.replace(\' \', \'_\', \'g\'), \'t\': q});\n
ul.append(li);\n ul.append(li);\n
var s = q;\n var s = q;\n
...@@ -339,7 +344,7 @@ function hashController ()\n ...@@ -339,7 +344,7 @@ function hashController ()\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>9491</int> </value> <value> <int>9841</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -227,6 +227,12 @@ div.software_release_more {position:relative; width:100%; height: 26px;backgroun ...@@ -227,6 +227,12 @@ div.software_release_more {position:relative; width:100%; height: 26px;backgroun
.sr_left_active {float:right; margin: 2px; height:22px; width:24px; background:url(<tal:block tal:replace="images_path"/>sr_left_active.png);cursor: pointer;}\n .sr_left_active {float:right; margin: 2px; height:22px; width:24px; background:url(<tal:block tal:replace="images_path"/>sr_left_active.png);cursor: pointer;}\n
.sr_left_inactive {float:right; margin: 2px; height:22px; width:24px; background:url(<tal:block tal:replace="images_path"/>sr_left_inactive.png);}\n .sr_left_inactive {float:right; margin: 2px; height:22px; width:24px; background:url(<tal:block tal:replace="images_path"/>sr_left_inactive.png);}\n
div.software_release_page {float:right; margin: 4px; height:22px; color: white; font-site: 18px;}\n div.software_release_page {float:right; margin: 4px; height:22px; color: white; font-site: 18px;}\n
\n
ul.software_category {}\n
li.software_category {}\n
li.software_category:hover {background-color: #f7f6f0;}\n
li.software_category_selected {background-color: yellow;}\n
\n
</tal:block> </tal:block>
]]></unicode> </value> ]]></unicode> </value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment