Last active
August 29, 2015 14:08
-
-
Save akouryy/204dba491245b720bfba to your computer and use it in GitHub Desktop.
A: tags, B: files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A = [ | |
| ['6','千夜'] | |
| ['7','シャロ'] | |
| ['8','リゼ'] | |
| ['9','ココア'] | |
| ['0','チノ'] | |
| [] | |
| ['i','青山'] | |
| ['o','マヤ'] | |
| ['p','メグ'] | |
| [] | |
| ['h','ワイルドギース'] | |
| ['j','あんこ'] | |
| ['k','タカヒロ'] | |
| ['l','ティッピー'] | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ -> | |
| for x, i in A | |
| if x[0]? | |
| $ '<input>' | |
| .attr | |
| id: 'check-' + i | |
| type: 'checkbox' | |
| name: 'tag' | |
| value: i | |
| .insertBefore $ '#add-tag' | |
| $ '<label>' | |
| .attr | |
| for: 'check-' + i | |
| accesskey: x[0] | |
| .html x[1] + '(<b>' + x[0] + '</b>)' | |
| .insertBefore $ '#add-tag' | |
| $ '<textarea>' | |
| .attr | |
| id: 'tags-' + i | |
| rows: 5 | |
| .text x[1] + "\n" | |
| .appendTo $ 'body' | |
| else | |
| $('<br>').insertBefore $ '#add-tag' | |
| bi = 0 | |
| $('#add-tag').click f = -> | |
| try | |
| $('input:checked').each -> | |
| i = $(this).attr 'value' | |
| t = $('#tags-' + i) | |
| t.val(t.val() + B[bi] + "\n") | |
| $(this).attr 'checked', false | |
| catch e | |
| console.log e | |
| bi++; | |
| $ 'img' | |
| .attr | |
| src: B[bi] | |
| f() | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf8"/> | |
| <title>ぴょんぴょん</title> | |
| <script src="jQuery.js"></script> | |
| <script src="ぴょんぴょん.js"></script> | |
| </head> | |
| <body> | |
| <h1>ぴょんぴょん</h1> | |
| <img src="" alt="" height="400"/><br/> | |
| <br/><button id="add-tag" accesskey="+">タグ付け(+)</button><br/> | |
| </body> | |
| </html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment