-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
219 lines (183 loc) · 7.69 KB
/
Copy pathindex.html
File metadata and controls
219 lines (183 loc) · 7.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tag, the jQuery plugin to edit tags</title>
<link href="tag.ico" rel="shortcut icon">
<meta name="author" content="Georges Duverger">
<meta name="description" content="Tag, the jQuery plugin to edit tags">
<meta name="keywords" content="tag, jquery, plugin, edit, tags, tag cloud, tagcloud">
<link rel="stylesheet" href="http://yui.yahooapis.com/2.8.1/build/reset/reset-min.css">
<link rel="stylesheet" href="tag.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1><img src="img/label.png"> Tag</h1>
<h2>The jQuery plugin to edit tags</h2>
<a href="https://github.com/gduverger/tag"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://assets2.github.com/img/5d21241b64dc708fcbb701f68f72f41e9f1fadd6?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_left_red_aa0000.png&path=" alt="Fork me on GitHub"></a>
<!-- DEMO -->
<div class="demo">
<ul class="tags">
<li>Aggregators</li>
<li>Wikis</li>
<li>Folksonomy</li>
<li>User Centered</li>
<li>Joy of Use</li>
<li>Blogs</li>
<li>Participation</li>
<li>Six Degrees</li>
<li>Usability</li>
<li>Widgets</li>
<li>Pagerank</li>
<li>XFN</li>
<li>Social Software</li>
<li>FOAF</li>
<li>Recommendation</li>
<li>Sharing</li>
<li>Collaboration</li>
<li>Perpetual Beta</li>
<li>Simplicity</li>
<li>Browser</li>
<li>Videocasting</li>
<li>Podcasting</li>
<li>AJAX</li>
<li>Audio</li>
<li>IM</li>
<li>Video</li>
<li>Design</li>
<li>Convergence</li>
<li>Web 2.0</li>
<li>CSS</li>
<li>Pay Per Click</li>
<li>UMTS</li>
<li>Mobility</li>
<li>Atom</li>
<li>XHTML</li>
<li>SVG</li>
<li>Ruby on Rails</li>
<li>VC</li>
<li>Trust</li>
<li>Affiliation</li>
<li>OpenAPIs</li>
<li>RSS</li>
<li>Semantic</li>
<li>Web Standards</li>
<li>SEO</li>
<li>Economy</li>
<li>OpenID</li>
<li>Remixability</li>
<li>REST</li>
<li>Standardization</li>
<li>The Long Tail</li>
<li>DataDriven</li>
<li>Accessibility</li>
<li>XML</li>
<li>Modularity</li>
<li>SOAP</li>
<li>Microformats</li>
<li>Syndication</li>
</ul>
<a href="#" class="sprite edit-tags">Edit tags</a>
</div>
<!-- STYLE -->
<div class="styles">
<h3>Customizable style <span class="quiet">(try it below!)</span></h3>
<!-- Flickr -->
<div class="style">
<h4 class="flickr">Flickr style</h4>
<iframe src="demo/flickr.html"></iframe>
</div>
<!-- Quora -->
<div class="style middle">
<h4 class="quora">Quora style</h4>
<iframe src="demo/quora.html"></iframe>
</div>
<!-- Hunch -->
<div class="style">
<div class="quiet" style="float:right">noDelete: true</div>
<h4 class="hunch">Hunch style</h4>
<iframe src="demo/hunch.html"></iframe>
</div>
</div>
<div style="clear:left"></div>
<!-- CODE -->
<div class="code">
<h3>Unobtrusive scripting</h3>
<pre>
<span class="comment"><!-- Loads jQuery (through Google CDN) --></span>
<span class="element"><script <span class="attr-name">src=</span><span class="attr-value">"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"</span>></script></span>
<span class="comment"><!-- Loads the Tag script --></span>
<span class="element"><script <span class="attr-name">src=</span><span class="attr-value">"http://gduverger.com/tag/jquery.tag.js"</span>></script></span>
<span class="comment"><!-- Loads the Tag style sheet (or make your own!) --></span>
<span class="element"><link <span class="attr-name">rel=</span><span class="attr-value">"stylesheet"</span> <span class="attr-name">href=</span><span class="attr-value">"http://gduverger.com/tag/tag.css"</span>></span>
<span class="comment"><!-- Generate your list of existing tags --></span>
<span class="element"><ul <span class="attr-name">class=</span><span class="attr-value">"tags"</span>>
<span class="element"><li><span class="value">Aggregators</span></li></span>
<span class="element"><li><span class="value">Wikis</span></li></span>
</ul></span>
<span class="comment"><!-- Binds tag editing; fallback in case JavaScript is disabled --></span>
<span class="element"><a <span class="attr-name">href=</span><span class="attr-value">"editTags.html"</span> <span class="attr-name">class=</span><span class="attr-value">"edit-tags"</span>><span class="value">Edit tags</span></a></span>
<span class="element js"><script>
$(<span class="param">document</span>).ready(function() {
<span class="comment">// Binds the tag container (has to be the first parent)</span>
$(<span class="attr-value">".tags"</span>)<span class="function">.<em>tag</em></span>({
<span class="comment">// Defines how new tags are formed</span>
<span class="attr-name">tagTemplate:</span> <span class="attr-value">"<li>"</span>,
<span class="comment">// Defines what triggers the edit mode</span>
<span class="attr-name">editTagsSelector:</span> <span class="attr-value">".edit-tags"</span>,
<span class="comment">// Called when a tag is saved</span>
<span class="attr-name">saveTagCallback:</span> <span class="function">function( <span class="param">tag</span> )</span> {
<span class="comment">// AJAX call to update the tag on your server</span>
return <span class="constant">true</span>;
},
<span class="comment">// Called when a tag is removed</span>
<span class="attr-name">removeTagCallback:</span> function( <span class="param">tag</span> ) {
<span class="comment">// AJAX call to remove the tag from your server</span>
return <span class="constant">true</span>;
}
});
});
</script></span>
</pre>
</div>
<p>Try <a href="jquery.tag.js">jquery.tag.js</a> (with <a href="tag.css">tag.css</a> and <a href="tag.png">tag.png</a>) and send feedback or questions to <a href="http://twitter.com/gduverger">@gduverger</a></p>
<div class="footnote">Icons by <a href="http://pixel-mixer.com">pixel-mixer.com</a></div>
<!-- Grab Google CDN's jQuery. fall back to local if necessary -->
<!-- http://html5boilerplate.com/ -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="jquery-1.4.2.min.js"><\/script>')</script>
<script src="jquery.tag.js" type="text/javascript" charset="utf-8"></script>
<script>
// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
$(document).ready(function() {
$(".tags").tag({
tagTemplate: "<li>",
editTagsSelector: ".edit-tags",
doneEditingElement: "<a href='#' class='sprite done-editing'>Done editing</a>",
removeElement: "<a href='#' class='sprite remove-tag' title='Remove'>Remove</a>",
addElement: "<a href='#' class='sprite add-tag' title='Add'>Add</a>",
saveTagCallback: function( tag ) {
// var tags_string;
// $(tags).each(function() { tags_string += this.newValue ? this.newValue + "," : this.oldValue + ","; });
log( "SAVE: " + tag.newValue); // + ", tags: " + tags_string );
return true;
},
removeTagCallback: function( tag ) {
// var tags_string;
// $(tags).each(function() { tags_string += this.newValue ? this.newValue + "," : this.oldValue + ","; })
log( "REMOVE: " + tag.oldValue); // + ", tags: " + tags_string );
return true;
}
});
});
</script>
</body>
</html>