2012-05-19 13:42:45 +00:00
|
|
|
<!-- Defining Amplify Requests -->
|
|
|
|
<script>
|
|
|
|
var ajaxURL = baseurl+'/ajax';
|
|
|
|
|
|
|
|
//Update sidebar
|
|
|
|
amplify.request.define( "videos", "ajax", {
|
|
|
|
url: ajaxURL+"/videos.php",
|
|
|
|
type: "POST",
|
|
|
|
dataType: "json",
|
|
|
|
decoder: function( data, status, xhr, success, error ) {
|
|
|
|
if ( status === "success" ) {
|
|
|
|
success( data );
|
|
|
|
} else {
|
|
|
|
error( data );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2012-05-22 11:34:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
//defining up clipbucjet ajax request
|
|
|
|
amplify.request.define( "main", "ajax", {
|
|
|
|
url: ajaxURL+"/main.php",
|
|
|
|
type: "POST",
|
|
|
|
dataType: "json",
|
|
|
|
decoder: function( data, status, xhr, success, error ) {
|
|
|
|
if ( status === "success" ) {
|
|
|
|
success( data );
|
|
|
|
} else {
|
|
|
|
error( data );
|
|
|
|
}
|
2012-05-19 13:42:45 +00:00
|
|
|
}
|
2012-05-22 11:34:45 +00:00
|
|
|
});
|
|
|
|
|
2012-05-28 07:10:27 +00:00
|
|
|
//photos private message
|
|
|
|
amplify.request.define( "photos", "ajax", {
|
|
|
|
url: ajaxURL+"/photos.php",
|
|
|
|
type: "POST",
|
|
|
|
dataType: "json",
|
|
|
|
decoder: function( data, status, xhr, success, error ) {
|
|
|
|
if ( status === "success" ) {
|
|
|
|
success( data );
|
|
|
|
} else {
|
|
|
|
error( data );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2012-05-19 13:42:45 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Working With the Javascript -->
|
|
|
|
|
2012-04-28 20:11:43 +00:00
|
|
|
<script type="text/javascript">
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-04-28 20:11:43 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
|
2012-09-01 19:08:08 +00:00
|
|
|
$('.popover-class').popover();
|
2012-08-16 20:10:07 +00:00
|
|
|
//Adding Comment Hover effect
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
$('.comments').on('mouseenter','.comment',function(){
|
|
|
|
$(this).find('.comment-options').show();
|
|
|
|
});
|
2012-04-28 20:11:43 +00:00
|
|
|
|
|
|
|
//Adding Comment Mouse-leave effect
|
2012-08-16 20:10:07 +00:00
|
|
|
$('.comments').on('mouseleave','.comment',function(){
|
|
|
|
$(this).find('.comment-options').hide();
|
|
|
|
});
|
|
|
|
|
|
|
|
//Adding Spam comment function
|
|
|
|
$('.comments').on('click','.spam-comment',function(){
|
|
|
|
var cid = $(this).attr('data-id');
|
|
|
|
var type = $(this).attr('data-type');
|
|
|
|
var typepid = $(this).attr('data-type-id');
|
|
|
|
spam_comment(cid,type,typepid);
|
|
|
|
})
|
|
|
|
|
|
|
|
//Unspam
|
|
|
|
$('.comments').on('click','.unspam-comment',function(){
|
|
|
|
var cid = $(this).attr('data-id');
|
|
|
|
var type = $(this).attr('data-type');
|
|
|
|
var typepid = $(this).attr('data-type-id');
|
|
|
|
unspam_comment(cid,type,typepid);
|
|
|
|
})
|
|
|
|
|
|
|
|
//view hide comment...
|
|
|
|
$('body').on('click','.view-toggle',function(){
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
var $toggleobj = $('#'+$(this).attr('data-toggle-id'));
|
|
|
|
var $toggletext = $(this).attr('data-toggle-text');
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
$toggleobj.toggle();
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Changing text...
|
|
|
|
if($toggletext)
|
|
|
|
{
|
|
|
|
$(this).attr('data-toggle-text',$(this).text());
|
|
|
|
$(this).text($toggletext);
|
|
|
|
}
|
2012-06-21 11:22:38 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
})
|
2012-06-21 11:22:38 +00:00
|
|
|
|
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Init Login Modal box
|
|
|
|
$('#login-modal').modal({
|
|
|
|
show : false
|
|
|
|
});
|
2012-04-28 20:11:43 +00:00
|
|
|
|
2012-05-28 12:51:27 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Initializing Select/Deselect All function
|
|
|
|
$('.select_all').click(function(){
|
2012-05-28 12:51:27 +00:00
|
|
|
$target = $(this).attr('data-target');
|
|
|
|
$controller = this;
|
|
|
|
if($(this).is(':checked'))
|
|
|
|
{
|
|
|
|
$('.'+$target).attr('checked',true);
|
|
|
|
}else
|
|
|
|
{
|
|
|
|
$('.'+$target).attr('checked',false);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Bind function to the target..
|
|
|
|
$('.'+$target).click(function(){
|
|
|
|
$($controller).attr('checked',false);
|
|
|
|
})
|
2012-08-16 20:10:07 +00:00
|
|
|
});
|
2012-05-28 12:51:27 +00:00
|
|
|
|
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Init Drop Downs
|
|
|
|
$('.cb-dropdown').dropdown();
|
2012-09-01 19:08:08 +00:00
|
|
|
$('.cb-tabs-content a').click(function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$(this).tab('show');
|
|
|
|
});
|
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Hiding Children Categories
|
|
|
|
$('.categories-nav > ul > li > ol').hide();
|
|
|
|
//Adding Toggle
|
|
|
|
$('.categories-nav > ul > li .icon-toggle').click(function(){
|
|
|
|
$('.categories-nav > ul > li > ol').toggle();
|
2012-05-19 13:42:45 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
if($('.categories-nav > ul > li > ol').css('display')=='none')
|
|
|
|
{
|
|
|
|
$(this).removeClass('toggle-invert');
|
|
|
|
$(this).parent().removeClass('active');
|
|
|
|
}else
|
2012-05-19 13:42:45 +00:00
|
|
|
{
|
|
|
|
$(this).addClass('toggle-invert');
|
|
|
|
$(this).parent().addClass('active');
|
|
|
|
}
|
2012-08-16 20:10:07 +00:00
|
|
|
})
|
2012-05-23 18:32:45 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Update Playlist Page
|
|
|
|
updatePlaylistPage();
|
2012-05-23 18:32:45 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//reset form on showing modal
|
|
|
|
$('#create-playlist-modal').on('show', function () {
|
|
|
|
$('#create-playlist-modal form')[0].reset();
|
|
|
|
$('#create-playlist-error').hide().html('');
|
|
|
|
});
|
2012-05-23 18:32:45 +00:00
|
|
|
|
2012-08-16 20:10:07 +00:00
|
|
|
//Executing Tootltip
|
2012-05-25 11:15:58 +00:00
|
|
|
$('.cb-tooltip').tooltip();
|
|
|
|
|
2012-05-28 12:51:27 +00:00
|
|
|
|
2012-05-30 14:56:38 +00:00
|
|
|
//Adding sortablities
|
|
|
|
$('#playlist-manage').sortable({
|
|
|
|
handle : '.move',
|
|
|
|
placeholder: "ui-state-highlight",
|
|
|
|
axis: 'y',
|
|
|
|
stop : function(event,ui){
|
|
|
|
|
|
|
|
var formdata =
|
2012-08-16 20:10:07 +00:00
|
|
|
$('#playlist-manage-form')
|
2012-05-30 14:56:38 +00:00
|
|
|
.serialize();
|
|
|
|
|
|
|
|
|
|
|
|
update_manage_playlist_order();
|
|
|
|
|
|
|
|
formdata += '&mode=update_playlist_order';
|
|
|
|
|
|
|
|
amplify.request('main',formdata,function(data){
|
|
|
|
if(data.err)
|
|
|
|
{
|
|
|
|
displayError(data.err);
|
|
|
|
}else
|
|
|
|
{
|
2012-08-16 20:10:07 +00:00
|
|
|
"...";
|
2012-05-30 14:56:38 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.save-plst-text').click(function(){
|
|
|
|
|
|
|
|
$(this).button('loading');
|
|
|
|
var item_id = $(this).attr('data-id');
|
|
|
|
var text = $('#'+item_id+'-text').val();
|
|
|
|
|
|
|
|
save_playlist_item_note(item_id,text);
|
|
|
|
})
|
|
|
|
|
2012-05-28 12:51:27 +00:00
|
|
|
|
2012-05-30 14:56:38 +00:00
|
|
|
|
|
|
|
$('.remove_playlist_item').click(function(){
|
|
|
|
var title = $(this).attr('data-confirm-title');
|
|
|
|
var text = $(this).attr('data-confirm-text');
|
|
|
|
var id = $(this).attr('data-id');
|
|
|
|
cb_confirm(title,text,function(){
|
|
|
|
remove_playlist_item(id);
|
|
|
|
});
|
|
|
|
})
|
2012-08-16 20:10:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Setting up upload buttons
|
|
|
|
*/
|
|
|
|
$('.upload_options').on('click','li',function(){
|
|
|
|
|
|
|
|
toggle_upload(this);
|
|
|
|
})
|
|
|
|
|
|
|
|
toggle_upload($('.upload_options li:first'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.upload_list_container').on('click','.upload_list',function(){
|
|
|
|
toggle_upload_list(this);
|
2012-09-01 19:08:08 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$('.cbv3-scroller').lionbars({
|
|
|
|
autohide: true
|
|
|
|
});
|
2012-04-28 20:11:43 +00:00
|
|
|
});
|
2012-05-30 14:56:38 +00:00
|
|
|
|
2012-04-28 20:11:43 +00:00
|
|
|
</script>
|