<html>
<head>
<title>Feed</title>
<meta charset="utf-8"">
<link rel="stylesheet" type="text/css" href="/static/css/main.css">
</head>
<div id="viewPort">
<div id="lister"></div>
<div id="mainContent"></div>
</div>
<script id="channelTemplate" type="text/template">
<div id="channelHeadline">
<div id="channelTitle">{{title}}</div>
<div id="channelOptions"></div>
</div>
<div id="channelListing"></div>
</script>
<script id="channelItemTemplate" type="text/template">
<div id="fi{{id}}" class="feedItem collapsed unread">
<div class="fiTitle">
<span class="date">{{date}}</span>
<div class="fiContent">
<span class="fiStarred">*</span>
<span class="title">{{title}}</span>
<span class="desc"> - {{desc}} </span>
</div>
</div>
<div class="fiData">
<h1><a href="{{item.source_link}}" target="_blank">{{title}}</a></h1>
{{summary}}
</div>
</div>
</script>
<script src="/static/js/jquery.js"></script>
<script src="/static/js/sammy.js"></script>
<script src="/static/js/mustache.js"></script>
<script src="/static/js/feedJuice.js"></script>
<script src="/static/js/feed.js"></script>
</html>
=================
And then, my app (feed.js):
=================
(function($) {
var feedishRouter = $.sammy('#mainContent', function() {
this.get('#/channel/:id', function(context) {
that = this;
context.$element().html(Mustache.to_html($('#channelTemplate').html()));
var clTpl = $('#channelItemTemplate').html();
$.get('/channelContent/' + that.params['id'], function(data) {
$.each($.parseJSON(data), function(index, currentData) {
var listItemRendered = Mustache.to_html(clTpl, currentData);
$('#channelListing').append(listItemRendered);
});
});
});
this.get('#/search/:query', function(context) {
context.$element().html('searching for <b>' + this.params['query'] +'</b>');
});
});
$(function() {
feedishRouter.run('#/explore');
});
} (jQuery));
=================
I'm wondering where to place jquery event-based code that would trigger at anytime. E.g. a click on an item with the "fiTitle" class. So something like:
=================
$('.fiTitle').click(function() {
var $currentID = '#' + $($(this).parent()).attr('id');
if($($currentID).hasClass('collapsed')) {
$($currentID + ' .fiData').show();
$($currentID).removeClass('collapsed');
$($currentID).addClass('expanded');
$($currentID).removeClass('unread');
} else if($($currentID).hasClass('expanded')) {
$($currentID + ' .fiData').hide();
$($currentID).removeClass('expanded');
$($currentID).addClass('collapsed');
}
});
=================
I appreciate the assistance,
Jeff M
Confidential Information and Disclaimer:
This communication sent from "Viitorcloud Technologies Private Limited" is confidential and intended solely for the use of addresses. Any retransmission, dissemination or the use of this information by persons other than addressee is unlawful and prohibited. The views expressed here-in (including any attachments) are those of the individual sender only. We do not accept any liability what-so-ever including on account of any errors, omissions, viruses etc in the contents of this message.
--
You received this message because you are subscribed to the Google Groups "Sammy.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sammyjs+u...@googlegroups.com.
To post to this group, send email to sam...@googlegroups.com.
Visit this group at http://groups.google.com/group/sammyjs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Hello, Jeff, i have the same problem. i tried everything, but still no solution found. if u find any solution, please let me know...