clipbucket/upload/admin_area/styles/cbv3/layout/javascript.html
Fawaz cf12482ffc Updated : Photo Settings and Watermark Settings page to Bootstrap
Added : Javascript Ratio and Watermark placement selector
Updated : Photo thumb and medium thumb auto height calculator
Added : New CSS in default.css
2012-07-19 10:56:10 +00:00

144 lines
No EOL
4.7 KiB
HTML

<script>
$(document).ready(function()
{
$('.popover-class').popover();
$('a[rel=tooltip]').tooltip();
//Setting Up the Left Column and Menu List
$('.nav-sub-menu').each(function(){
var ref = $(this).attr('ref');
var cookie = $.cookie('menu-'+ref);
if(cookie!='show')
$(this).hide();
})
$('.nav-header').bind('click',function(){
var ref = $(this).attr('ref');
var obj = $('.nav-sub-menu[ref='+ref+']');
if(obj.css('display')=='none')
$.cookie('menu-'+ref,'show');
else
$.cookie('menu-'+ref,'hide');
obj.slideToggle('normal');
});
/* Setting up side bars menu */
$('#sidebars-list li a').bind('click',function(){
toggleSidebar(this);
})
toggleSidebar('#sidebars-list li a:first');
/* Setting up widgets dragablity */
$('.admin-widget-box').draggable({
cursor: "hand",
cursorAt: { left: 25 },
revert : 'invalid',
handler : 'img',
helper : function (event)
{
var text = $(this).find('.admin-widget-box-title').text();
return '<button class="btn btn-sidebar-dragable">'+text+'</button>';
},
drag : function (event,ui){
$(this).css('background-color','#ccc');
},
stop : function (event,ui){
$(this).css('background-color','#fff');
}
});
/* And so dropability */
$('.sidebar-widgets .drop-widget-area').droppable({
drop:function(event,ui)
{
var theWidget = ui.draggable;
createWidget($(theWidget).attr('id'),
$(this).parent().attr('id'));
}
});
/* Adding Widgets Sortability */
$('.widgets-list').sortable({
cursor: "move",
'items' : 'div.widget-bar',
'axis' : 'y' ,
'placeholder': "ui-state-highlight",
'containment' : '.widgets-list',
'update': function(event, ui) {
var $sidebar = $(this).attr('itemref');
saveSidebar($sidebar);
}
});
$(".sidebar-widgets").disableSelection();
//Init the modal
$('.modal').modal({
show : false
});
//Fixing Bars
$( '.scrolltoFixed' ).scrollToFixed({
preFixed: function() { $(this).addClass('controller-fixed')},
postFixed: function() { $(this).removeClass('controller-fixed'); },
});
//Hiding Pointers
//$('.loading_pointer').hide();
$('.manager-list').on('click','.check-all',function(){
if($(this).find('input[type=checkbox]').is(':checked'))
{
$(this).parents('.manager-list')
.find('.table input[type=checkbox]')
.prop("checked",true);
}else
{
$(this).parents('.manager-list')
.find('.table input[type=checkbox]')
.prop("checked",false);
}
});
$('.manager-list').on('click','.check-item',function(){
var $parent = $(this).parents('.list-block');
var boxes = $($parent).find('input[type=checkbox]').length;
var checked = $($parent)
.find('input[type=checkbox]:checked')
.length;
if(boxes!=checked)
{
$(this).parents('.manager-list')
.find('.check-all input')
.prop("checked",false);
}else
{
$(this).parents('.manager-list')
.find('.check-all input')
.prop("checked",true);
}
});
$('.photo-ratio-boxes').on('click','.thumbnail',function(){
$(this).parents('.photo-ratio-boxes').find('.checked').removeClass('checked').end().end().addClass('checked')
});
$('.watermark-placement').on('click','.watermark-placement-holder',function(){
$(this).siblings('.checked').removeClass('checked').end().addClass('checked');
})
})
</script>