<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reddrummer - Groups</title>
<meta http-equiv="content-type" content="application/xhtml+xml" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="apple-touch-icon" href="images/icon.png" />
<!--CSS-->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--jQuery-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.tools.min.js"></script>
<script type="text/javascript" src="js/dropdown.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript" src="js/highdpi.js"></script>
<!--Cordova-->
<script type="text/javascript" src="cordova.js"></script>
<!-- Javascript APP -->
<script type="text/javascript" src="js/init.js"></script>
<script type="text/javascript">
$(function() {
$( "#accordion" ).accordion();
//Groups function
//
$(".li_sub").click(function(event){
event.preventDefault();
$.ajax({
type:'GET',
url:'http://api.reddrummer.com/groups/mygroups.json?api_key=' + session.token,
dataType: 'application/json',
success: function(){
jsonData = JSON.parse(data);
for (var i = 0; i < jsonData.groups.length; i++) {
var groupComplete = jsonData.groups[i]._self;
array = groupComplete.split('/');
idGroup = array[array.length-1];
groupBound = array[array.length-2];
if (groupBound == 'houseorgan') {
$("#in").html("<ul><li id=" + idGroup + " name=" + groupBound + " ><a href='#' class='see-posts'>" +
jsonData.groups[i].name + "</a></li></ul>");
} else if (groupBound == 'brandchannel'){
$("#out").html("<ul><li id=" + idGroup + " name=" + groupBound + " ><a href='#' class='see-posts'>" +
jsonData.groups[i].name + "</a></li></ul>");
} else {
$("#social").html("<ul><li id=" + idGroup + " name=" + groupBound + " ><a href='#' class='see-posts'>" +
jsonData.groups[i].name + "</a></li></ul>");
}
};
},
error: function(msg){
navigator.notification.alert(msg);
}
});
});
$(".see-posts").click(function(event){
event.preventDefault();
var group_id = $(event.currentTarget).attr('id');
var groub_bound = $(event.currentTarget).attr('name');
$.ajax({
url = 'http://api.reddrummer.com/groups/postsbygrouplimitoffset.json/' + group_id + '/5/0?api_key=' + session.token,
data = {'group_id': group_id},
success: function(){
navigator.notification.alert('msg');
},
error: function(msg){
navigator.notification.alert(msg);
}
});
});
});
</script>
</head>
<body>
<!--Search box (this layer is hidden)-->
<div class="box" id="box">
<!--Form search-->
<form action="" method="post" name="search">
<h4>Search</h4>
<input type="text" name="search" placeholder="Search..." class="input_text" />
<br />
<div class="buttons">
<a href="javascript:document.search.submit();" title="Search" class="button gray search_button">
<span class="before"></span>
Search
<span class="after"></span>
</a>
<a title="Close" id="boxclose" class="button gray search_button">
<span class="before"></span>
Close
<span class="after"></span>
</a>
</div>
</form>
<!--Form search Ends-->
</div>
<!--Search box Ends-->
<!--Top page (logo, search and alert button)-->
<div id="top" class="page_x">
<div id="header">
<div id="content_header">
<a href="logged.html">
<img src="images/logo.png" width="120px" height="36px" alt="Reddrummer Mobile" style="padding-top: 6px;" />
</a>
<a href="#" id="activator">
<img src="images/search.png" width="38px" height="37px" alt="Search" class="replace-2x search" />
</a>
<a href="#" id="alert">
<img src="images/alert.png" width="38px" height="37px" alt="Alert" class="replace-2x search" />
</a>
</div>
</div>
</div>
<!--Top page Ends-->
<!--Navigation-->
<div id="navigation">
<div id="content_navigation">
<a href="javascript:history.back()">
<img src="images/back.png" width="78px" height="35px" alt="Go back" class="replace-2x butt_black left" />
</a>
<a href="#" id="categories-button">
<img src="images/navigation.png" width="102px" height="35px" alt="Open menu" class="replace-2x butt_black right" />
</a>
<div id="categories-dropdown">
<div class="categories-inside">
<ul>
<li><a href="logged.html">Home</a></li>
<li><a href="read.html">Posts</a></li>
<li><a href="write.html">Write</a></li>
<li><a href="profile.html">Profile</a></li>
<li><a href="channels.html">Channels</a></li>
<li><a href="groups.html">Groups</a></li>
<li><a href="javascript:doLogout();">Logout</a></li>
</ul>
</div>
</div>
</div>
</div>
<!--Navigation Ends-->
<!--Main contents-->
<div class="box_center" id="page_x" style="width:100%; height: 100%">
<div class="demo">
<div id="accordion">
<ul class="accordion">
<li id="in" class="li_sub">Inbound</li>
<li id="out" class="li_sub">Outbound</li>
<li id="social" class="li_sub">Socialbound</li>
</ul>
</div>
</div>
</div>
<!--Main contents Ends-->
<!--Footer-->
<div id="footer" style="margin: 0 0 0 0;">
<div id="content_footer">
<!--Your copyright-->
<div id="copyright">
All rights reserved 2013
</div>
<!--Your copyright Ends-->
<!--Back to top button-->
<div id="back_to_top">
<a href="#">
<img src="images/back_to_top.png" width="17px" height="17px" class="replace-2x" alt="Back to top" />
<span> Back to top</span>
</a>
</div>
<!--Back to top button Ends-->
</div>
</div>
<!--Footer Ends-->
</body>
</html>