clipbucket/upload/styles/cbv3/layout/javascript.html

125 lines
3.5 KiB
HTML
Raw Normal View History

<!-- 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 );
}
}
});
//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 );
}
}
});
//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 );
}
}
});
</script>
<!-- Working With the Javascript -->
<script type="text/javascript">
$(document).ready(function(){
//Adding Comment Hover effect
$('.comment').bind('mouseover',function(e){
$(this).find('.comment-options').show();
});
//Adding Comment Mouse-leave effect
$('.comment').bind('mouseout',function(e){
$(this).find('.comment-options').hide();
});
//Init Login Modal box
$('#login-modal').modal({
show : false
});
//Initializing Select/Deselect All function
$('.select_all').click(function(){
$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);
})
});
//Init Drop Downs
$('.cb-dropdown').dropdown();
//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();
if($('.categories-nav > ul > li > ol').css('display')=='none')
{
$(this).removeClass('toggle-invert');
$(this).parent().removeClass('active');
}else
{
$(this).addClass('toggle-invert');
$(this).parent().addClass('active');
}
})
//Update Playlist Page
updatePlaylistPage();
//reset form on showing modal
$('#create-playlist-modal').on('show', function () {
$('#create-playlist-modal form')[0].reset();
$('#create-playlist-error').hide().html('');
});
//Executing Tootltip
$('.cb-tooltip').tooltip();
});
</script>