minor update
This commit is contained in:
1 parent
74b2bbf4b7
commit
4215ed5538
7 files changed
+180
-81
No files matched your search
@@ -109,7 +109,7 @@ var orbitDesktop = function(dom){
|
||||
this.themesettings = "";
|
||||
this.theme = "4f8d3f493b67fcd05f086359";
|
||||
this.transitionTime = 1000;
|
||||
this.currenthtml = "desktop.html";
|
||||
this.currenthtml = "home";
|
||||
this.currentface = "home";
|
||||
this.desktopData = {};
|
||||
this.tp = "";
|
||||
@@ -378,8 +378,8 @@ var orbitDesktop = function(dom){
|
||||
};
|
||||
|
||||
this.layout_data = function(h){
|
||||
var $e;
|
||||
var column_container,layout, base_width, total_width, gutter, no_of_entries = 0, pagination_link, pagination_variable;
|
||||
var $e;
|
||||
var column_container,layout, base_width , no_of_entries = 0, pagination_link , pagination_variable, gutter, total_width;
|
||||
o.paging = true;
|
||||
gutter = (!isNaN(gutter)) ? gutter : 12;
|
||||
this.layout_data.generate_layout_html = function(l){
|
||||
@@ -393,6 +393,7 @@ var orbitDesktop = function(dom){
|
||||
case "simple":
|
||||
total_columns++;
|
||||
temp_div.append(column_container.html());
|
||||
total_width = "auto";
|
||||
break;
|
||||
case "datalist":
|
||||
no_of_entries = (typeof column_container.attr("per-column") != "undefined"? parseInt(column_container.attr("per-column")) : 4);
|
||||
@@ -411,7 +412,10 @@ var orbitDesktop = function(dom){
|
||||
x = 0;
|
||||
temp_div.append(column);
|
||||
}
|
||||
});
|
||||
})
|
||||
if(x != 0){
|
||||
temp_div.append(column);
|
||||
}
|
||||
}
|
||||
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
||||
break;
|
||||
@@ -419,17 +423,16 @@ var orbitDesktop = function(dom){
|
||||
entries = column_container.find("div[column=true]"),x = 0,column;
|
||||
if(entries.length!=0){
|
||||
entries.each(function(i,ul){
|
||||
column = $("<div class='column type_column' style='width:"+base_width+"px;margin-right:"+gutter+"px;padding-right:"+gutter+"px;'></div");
|
||||
column = $("<div class='column type_column' style='width:"+base_width+"px;margin-right:"+gutter+"px;padding-right:"+gutter+"px;'></div");
|
||||
total_columns++;
|
||||
column.append(ul);
|
||||
x++;
|
||||
temp_div.append(column);
|
||||
});
|
||||
})
|
||||
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
||||
}
|
||||
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
// total_width = (!isNaN(base_width) ? ( base_width + 12 ) * total_columns : null);
|
||||
@@ -710,19 +713,7 @@ var orbitDesktop = function(dom){
|
||||
dragged.removeClass("noClick");
|
||||
|
||||
});
|
||||
var element = $('.gridster li');
|
||||
$.each(element, function(i){
|
||||
if($(this).attr("data-category")=="app" && $(this).find('.text_wrapper').length < 1){
|
||||
$(this).find('.appname').wrapInner('<span class="text_wrapper"/>');
|
||||
var w = $(this).find('.text_wrapper').width();
|
||||
if (w > 96){
|
||||
var text = $(this).find('.text_wrapper').text();
|
||||
slice = text.substr(0,12);
|
||||
$(this).find('.text_wrapper').attr('title',text).text(slice+'...');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
o.appname_substr('.gridster li');
|
||||
o.simple_drop_down();
|
||||
o.tinyscrollbar_ext({
|
||||
main: '.tinycanvas'
|
||||
@@ -731,22 +722,43 @@ var orbitDesktop = function(dom){
|
||||
var loadTiles = function(id){ //This will load tiles for a specific desktop .. id of section has to be passed here to load tiles
|
||||
$("#desktop #group_wrapper").empty();
|
||||
$.getJSON("/desktop/getgroups",{sectionid:id},function(tiles){
|
||||
tiles.sort(o.sortJSON("position",true,parseInt));
|
||||
// tiles.sort(o.sortJSON("position",true,parseInt));
|
||||
var tilecolors = o.themesettings.tilecolor;
|
||||
var totaltiles_in_a_row = 4;
|
||||
var opacity = ["op07","op08","op09",""];
|
||||
var row = 1, col = 1, x = 1, y = 1;
|
||||
var row = 0, col = 1, x = 1, y = 1, total_x = 0, prev_y = 0;
|
||||
var $group = $('<div class="grid gridster"></div>');
|
||||
var $ul = $('<ul></ul>');
|
||||
|
||||
$.each(tiles,function(i,tile){
|
||||
if(row >= 4){
|
||||
row = 1;
|
||||
col++;
|
||||
}
|
||||
var shape = tile.shape.split(" ");
|
||||
x = parseInt(shape[0].substr(1,1));
|
||||
y = parseInt(shape[1].substr(1,1));
|
||||
// if(tile.title == "Weather")console.log("Big - row : " + tile.row + ", col : "+ tile.column);
|
||||
// if(tile.title == "Google Scholar")console.log("Scholar - row : " + tile.row + ", col : "+ tile.column);
|
||||
|
||||
// if(total_x % 2 != 0)
|
||||
// row = row - y;
|
||||
// if(i == 7)tile.row = null;
|
||||
if(tile.row){
|
||||
row = tile.row;
|
||||
col = tile.column;
|
||||
x = parseInt(shape[0].substr(1,1));
|
||||
y = parseInt(shape[1].substr(1,1));
|
||||
}else{
|
||||
x = parseInt(shape[0].substr(1,1));
|
||||
if(total_x % 2 == 0){
|
||||
row = row + y;
|
||||
}else if(x == 1){
|
||||
col++;
|
||||
}
|
||||
y = parseInt(shape[1].substr(1,1));
|
||||
total_x = total_x + ( x * y );
|
||||
prev_y = y;
|
||||
if(total_x > 8){
|
||||
row = 1;
|
||||
total_x = 0;
|
||||
col++;
|
||||
}
|
||||
}
|
||||
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
||||
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
||||
var f = (tile.fullsize?"fullsize":null);
|
||||
@@ -757,7 +769,7 @@ var orbitDesktop = function(dom){
|
||||
$li = $('<li data-id="'+tile.id+'" class="widget '+f+'" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><div class="appholder"></div><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||
}
|
||||
|
||||
row = row + y;
|
||||
|
||||
|
||||
$ul.append($li);
|
||||
});
|
||||
@@ -805,6 +817,7 @@ var orbitDesktop = function(dom){
|
||||
$("#desktop #section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp hh1" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
|
||||
});
|
||||
bindSecondaryHandlers();
|
||||
o.simple_drop_down();
|
||||
}else{
|
||||
loadSectionList();
|
||||
loadTiles(o.sectionId);
|
||||
@@ -878,6 +891,7 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
return false;
|
||||
});
|
||||
o.appname_substr('#group_wrapper .element');
|
||||
}
|
||||
var loadApps = function(){ //this load apps for sorting and searching
|
||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||
@@ -977,9 +991,9 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
|
||||
$.post("/desktop/save_desktop_settings",{"save":"appnewsection","appid":ui.draggable.attr("id"),"newsectionid":$(this).data("content"),"desktopid":o.desktopId});
|
||||
if(o.sectionId == $(this).data("content") || o.sectionId == elementParent.attr("id")){
|
||||
// if(o.sectionId == $(this).data("content") || o.sectionId == elementParent.attr("id")){
|
||||
o.desktopData["home"]="";
|
||||
}
|
||||
// }
|
||||
}
|
||||
$(this).find('span.tile').addClass('op06',400);
|
||||
},
|
||||
@@ -991,6 +1005,10 @@ var orbitDesktop = function(dom){
|
||||
},
|
||||
accept: '.to_drop'
|
||||
});
|
||||
o.tinyscrollbar_ext({
|
||||
main: '.tinycanvas',
|
||||
});
|
||||
o.appname_substr('#group_wrapper .element',9);
|
||||
};
|
||||
var loadApps = function(){ // this loads apps from db to in each sections
|
||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||
@@ -1583,6 +1601,35 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
});
|
||||
}
|
||||
this.use_select2 = function(){
|
||||
$('select:not(.select2-offscreen)').select2({
|
||||
minimumResultsForSearch: -1
|
||||
// minimumInputLength: -1
|
||||
});
|
||||
}
|
||||
this.appname_substr = function(target,length){
|
||||
var $target = $(target),
|
||||
length = (length && typeof length == 'number') ? length : 12,
|
||||
wrapper = '<span class="text_wrapper"/>',
|
||||
w1, w2;
|
||||
if(!$target && $target.find('.text_wrapper').length > 0){
|
||||
return;
|
||||
} else {
|
||||
for(i = 0; i < $target.length; i++){
|
||||
var $this = $target.eq(i);
|
||||
if($this.find('.appname').text().length > length + 1){
|
||||
$this.find('.appname').wrapInner(wrapper);
|
||||
w1 = $this.find('.appname').width() - 24
|
||||
w2 = $this.find('.text_wrapper').width();
|
||||
if(w2 > w1){
|
||||
var text = $this.find('.text_wrapper').text();
|
||||
slice = text.substr(0,length);
|
||||
$this.find('.text_wrapper').attr('title',text).text(slice+'...');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
o.initialize();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,32 +8,37 @@ var orbitDesktopAPI = function(){
|
||||
//msg (string) : message to display
|
||||
//type (string : success, imp, alert
|
||||
//time (int) : duration for notification in seconds
|
||||
var $notify = $("#orbitnote");
|
||||
var img, n_height;
|
||||
var $notify = $('#orbitnote'),
|
||||
ani_method = { direction: 'up',easing: 'easeInOutQuint' },
|
||||
img, n_height;
|
||||
if(!type)type="";
|
||||
switch(type){
|
||||
case "alert":
|
||||
img = "note_alert.png";
|
||||
img = "exclamation-sign";
|
||||
break;
|
||||
case "imp":
|
||||
img = "note_imp.png";
|
||||
img = "warning-sign";
|
||||
break;
|
||||
case "success":
|
||||
img = "note_success.png";
|
||||
img = "ok";
|
||||
break;
|
||||
default:
|
||||
img = "note_alert.png";
|
||||
img = "exclamation-sign";
|
||||
break;
|
||||
}
|
||||
$notify.find("img#note_img").attr("src",o.notifyImgPath+img);
|
||||
$notify.find(".note_message").html(msg);
|
||||
n_height = $notify.outerHeight();
|
||||
if(!time)time=5000; else time=time*1000;
|
||||
$notify
|
||||
.css({'top':-n_height, 'display':'block', 'opacity':0})
|
||||
.animate({top:0,opacity:1},200)
|
||||
if( !time || time > 20) time = 5000; else time = time*1000;
|
||||
|
||||
var sign = '<div class="note_type"><span class="sign icon-'+ img +'"></span></div>',
|
||||
message = '<div class="note_message">'+ msg +'</div>',
|
||||
item = '<div class="note_holder admbg">'+ sign + message +'</div>';
|
||||
|
||||
$(item)
|
||||
.prependTo($notify)
|
||||
.stop(1,1)
|
||||
.toggle('slide', ani_method, 300)
|
||||
.delay(time)
|
||||
.animate({top:-n_height,opacity:0},200);
|
||||
.toggle('slide', ani_method, 800);
|
||||
$notify.find('.note_holder:hidden').remove();
|
||||
};
|
||||
this.executeFunc = function(func,callbackFn){
|
||||
//takes 2 arguments
|
||||
|
||||
Reference in new issue
Block a user