Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 40 lines (25 sloc) 1.14 kB
7b1071a @dejan first commit
authored
1 jquery.auto_html.js
2 ===================
3
e0d1d0f @dejan jQuery way
authored
4 jQuery port of Rails' extension [auto_html](http://github.com/dejan/auto_html)
7b1071a @dejan first commit
authored
5
6 ## Example usage
7
99113d4 @dejan update readme
authored
8 Given this comment div:
9
10 <div class="comment">
11 http://gogreece2014.com/wp-content/uploads/2013/09/mykonos8.jpg
12
13 And you will go to Mykonos
14 With a vision of a gentle coast
15 And a sun to maybe dissipate
16 Shadows of the mess you made
17
18 http://www.youtube.com/watch?v=DT-dxG4WWf4
19 </div>
20
21 and this script:
22
7b1071a @dejan first commit
authored
23 <script type="text/javascript">
5d95876 @dejan style
authored
24 $('.comment')
25 .simpleFormat()
26 .image()
27 .youtube({width:500, height:400})
28 .link();
7b1071a @dejan first commit
authored
29 </script>
30
99113d4 @dejan update readme
authored
31
32 The comment div will be transformed to this:
33
34 <p><img src="http://gogreece2014.com/wp-content/uploads/2013/09/mykonos8.jpg" alt="" width="500px"></p><p>And you will go to Mykonos<br>With a vision of a gentle coast<br>And a sun to maybe dissipate<br>Shadows of the mess you made</p><p><iframe class="youtube-player" type="text/html" width="500" height="400" src="http://www.youtube.com/embed/DT-dxG4WWf4" frameborder="0"></iframe>
35
36
7b1071a @dejan first commit
authored
37 ## Credits
38
99113d4 @dejan update readme
authored
39 Author: [Dejan Simic](http://github.com/dejan)
Something went wrong with that request. Please try again.