Skip to content

Commit

Permalink
better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Dec 20, 2011
1 parent 14a1ed6 commit 0cf00d6
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 64 deletions.
48 changes: 23 additions & 25 deletions src/gov-watch.coffee
Expand Up @@ -117,26 +117,36 @@ process_data = ->

)
$("#items").html(html)
item_hoveroff = () ->
$(this).find(".buxa-footer").html("")
item_hoveron = () ->
html = "<div id='disqus_thread' style='height:300px'></div><a href='http://disqus.com' class='dsq-brlink'>blog comments powered by <span class='logo-disqus'>Disqus</span></a>"
if not window.DISQUS
html += "<script type='text/javascript' async='true' src='http://govwatch.disqus.com/embed.js'/>"
window.disqus_identifier = 'recommendation'+$(this).attr('rel')
window.disqus_title = $(this).attr('title')

item_hoveroff = (item) ->
item.find(".buxa-footer").html("")
item_hoveron = (item) ->
window.disqus_identifier = 'recommendation'+item.attr('rel')
window.disqus_url = "http://gov-watch.org.il/#!"+window.disqus_identifier
$(this).find(".buxa-footer").html(html)
item.find(".buxa-footer").append( $("#disqus").detach() )
disqus_params =
reload: true
config: () ->
@page.identifier = window.disqus_identifier
@page.title = window.disqus_title
@page.url = window.disqus_url
if window.DISQUS
window.DISQUS.reset( disqus_params )
$(".item").hover( item_hoveron, item_hoveroff )

window.DISQUS.reset( disqus_params )
$(".hover-toggle").click(
->
e = $(this).parents(".item").first()
if e.hasClass('hover')
window.setTimeout( () -> item_hoveroff(e)
,
1000 )
e.removeClass('hover')
else
window.setTimeout( () -> item_hoveron(e)
,
1000 )
$(".item.hover").toggleClass('hover',false)
e.addClass('hover')
)

show_watermark(true)
$("#searchbox").change -> do_search()
$("#searchbox").focus ->
Expand Down Expand Up @@ -202,19 +212,7 @@ version_callback = (data) ->
H.findRecords('data/gov/decisions/', data_callback)

$ ->
json_data = localStorage?.data
json_all_books = localStorage?.all_books
json_all_chapters = localStorage?.all_chapters
json_version = localStorage?.version
if json_data and json_all_books and json_all_chapters and json_version
loaded_data = JSON.parse(json_data)
all_books = JSON.parse(json_all_books)
all_chapters = JSON.parse(json_all_chapters)
process_data()
# H.getRecord('data/gov/decisions', version_callback)
$.get("https://spreadsheets.google.com/feeds/cells/0AurnydTPSIgUdE5DN2J5Y1c0UGZYbnZzT2dKOFgzV0E/od6/public/values?alt=json-in-script",gs_data_callback,"jsonp");
# $.get("/Users/adam/workspace/gov-watch/src/values.json",gs_data_callback,"jsonp");

window.disqus_shortname = 'govwatch';
window.disqus_url = 'gov-watch.org.il'
window.disqus_developer = 1
Expand Down
14 changes: 7 additions & 7 deletions src/gov-watch.css
Expand Up @@ -103,7 +103,7 @@ body {
display:inline-block;
}

.item:hover {
.item.hover {
right:-50%;
transition: right 1s;
-webkit-transition: right 1s;
Expand Down Expand Up @@ -136,8 +136,8 @@ body {
transition-duration: 1s;
}

.item:hover .buxa-header,
.item:hover .buxa-footer {
.item.hover .buxa-header,
.item.hover .buxa-footer {
opacity:1;
-moz-transition-property: height,opacity;
-webkit-transition-property: height,opacity;
Expand All @@ -147,11 +147,11 @@ body {
transition-duration: 1s;
}

.item:hover .buxa-footer {
.item.hover .buxa-footer {
height:10em;
}

.item:hover .buxa-header {
.item.hover .buxa-header {
height:3em;
}

Expand All @@ -162,14 +162,14 @@ body {
-moz-transition: opacity 1s;
}

.item:hover .buxa {
.item.hover .buxa {
opacity:1;
transition: opacity 1s;
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
}

.item:hover .buxa.first {
.item.hover .buxa.first {
opacity:0;
transition: opacity 1s;
-webkit-transition: opacity 1s;
Expand Down
47 changes: 22 additions & 25 deletions src/gov-watch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 21 additions & 7 deletions src/index.html
@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html manifest="gov-watch.appcache">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="gov-watch.css" rel="stylesheet" type="text/css"></link>
<script type='text/javascript' src='jslib/jquery-1.6.4.min.js'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script type='text/javascript' src='jslib/mustache.js'></script>
<script type='text/javascript' src='jslib/hasadna-api.js'></script>
<script type='text/javascript' src='gov-watch.js'></script>
Expand All @@ -25,6 +25,7 @@
<li class="item shown" rel="{{_srcslug}}" title="{{recommendation}}">
<p class="buxa-header">
{{recommendation}}
&nbsp;<a class="hover-toggle" href="#">סגור</a>
</p>
<div style="clear:both;"></div>
<span class="buxa first">
Expand All @@ -38,7 +39,7 @@
<br/>
<span class="recommendation"><span class="recommendation-text">{{recommendation}}</span></span>
<span class="interaction">
[[ 1+ ]]&nbsp;&nbsp;[[ Like ]]&nbsp;&nbsp;<a href="#">דברו על זה</a>
<a class="hover-toggle" href="#">עוד...</a>
</span>
</span>
<span class="buxa">
Expand Down Expand Up @@ -92,10 +93,23 @@
<ul id='items'>
</ul>
</div>
<div style="display:none">
<div id="disqus">
<div id="disqus_thread"></div>
</div>
</div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'govwatch';

</script>
</body>
var disqus_shortname = 'govwatch'; // required: replace example with your forum shortname
var disqus_identifier = 'dummy1';
var disqus_developer = 1;
var disqus_url = 'http://gov-watch.org.il/';

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script></body>
</html>

0 comments on commit 0cf00d6

Please sign in to comment.