208 lines
No EOL
6.8 KiB
HTML
208 lines
No EOL
6.8 KiB
HTML
<script>
|
|
$(document).ready(function()
|
|
{
|
|
$('.popover-class').popover();
|
|
|
|
$('img[rel=tooltip], a[rel=tooltip], span[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'); },
|
|
});
|
|
|
|
if($( '.scrolltoFixedBottom' ).width()){
|
|
|
|
$( '.scrolltoFixedBottom' ).scrollToFixed({
|
|
bottom:0,
|
|
preFixed: function() { $(this).addClass('controller-fixed-bottom')},
|
|
limit: $('.scrolltoFixedBottom').offset().top - 50 ,
|
|
postFixed: function() { $(this).removeClass('controller-fixed-bottom'); }
|
|
});
|
|
}
|
|
|
|
//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);
|
|
}
|
|
});
|
|
|
|
$('.yes_no_toggle').on('click','.yes_no_toggle .btn',function(){
|
|
$val = $(this).attr('data-value');
|
|
|
|
if($val=='yes'){
|
|
$(this).parents('fieldset').find('input[value=yes]').prop("checked",true);
|
|
$(this).parents('fieldset').find('input[value=no]').prop("checked",false);
|
|
|
|
}
|
|
|
|
if($val=='no'){
|
|
$(this).parents('fieldset').find('input[value=no]').prop("checked",true);
|
|
$(this).parents('fieldset').find('input[value=yes]').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');
|
|
});
|
|
|
|
$('#select-all-thumbs').on('click',function(){
|
|
var total_thumbs = $('#collection-thumbs').find('input[type=checkbox]');
|
|
var checked_thumbs = $('#collection-thumbs').find('input:checked');
|
|
|
|
|
|
|
|
if ( checked_thumbs.length == total_thumbs.length ) {
|
|
// perforn uncheck
|
|
total_thumbs.prop('checked',false);
|
|
} else {
|
|
// perform check
|
|
total_thumbs.prop('checked',true);
|
|
}
|
|
})
|
|
|
|
|
|
|
|
$('.edit_lang').editable(baseurl+'/actions/update_phrase.php', {
|
|
indicator : '<img src="'+baseurl+'/images/icons/progIndicator.gif">',
|
|
tooltip : 'Click to edit...',
|
|
|
|
width :500}
|
|
);
|
|
|
|
|
|
|
|
$('#settings-container').masonry({
|
|
// options
|
|
itemSelector : '.settings-block',
|
|
columnWidth: 400,
|
|
isResizable : true
|
|
});
|
|
|
|
|
|
|
|
|
|
})
|
|
</script> |