some backend code change for sharing personal plugin module content. Added sharing in desktop for all the modules.
This commit is contained in:
1 parent
028c689739
commit
52c896d8c5
46 files changed
+224
-244
No files matched your search
@@ -29,6 +29,9 @@
|
||||
//column="true" this option is only for column layout... the columns will be formed on this column=true attribute and it should be a div
|
||||
//item=true this attribute should be present in the li tag. li with this attribute are considered as a separate item.
|
||||
|
||||
//enableLanguageSelect( dom ) children <a> will be binded with language, data-lang = string ex "en"|"zh_tw" will toggle all data-langunage throughout the page
|
||||
//enableSharing( dom ) children <a> will be binded with share, data-mode = string ex "public"|"private" will change the mode for all the selected items. the dom with class should have data-link = url data-var = vaiable_name, default will be mode
|
||||
|
||||
|
||||
$.extend($.expr[':'], {
|
||||
'containsi': function (elem, i, match, array) {
|
||||
@@ -1881,6 +1884,35 @@ var orbitDesktop = function(dom){
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
this.enableSharing = function( dom ){
|
||||
var el = $( dom ),
|
||||
variable = ( el.data( 'var' ) ? el.data( "var" ) : "mode"),
|
||||
_url = el.data( 'link' ) + "?" + variable + "=",
|
||||
classes = [];
|
||||
|
||||
el.find( "a" ).each( function(){
|
||||
classes.push( $( this ).attr( "item-class" ) ? $( this ).attr( "item-class" ) : $( this ).data( 'mode' ) );
|
||||
})
|
||||
|
||||
el.find( "a" ).click( function(){
|
||||
var ids = [],
|
||||
mode = $( this ).data( 'mode' ),
|
||||
inject_class = $( this ).attr( 'item-class' ) ? $( this ).attr( 'item-class' ) : mode;
|
||||
|
||||
$( ".overview li[item=true] a.icon-check" ).each( function(){
|
||||
ids.push( $( this ).data( 'id' ) );
|
||||
$( "li[data-id="+ $( this ).data( 'id' ) +"]").removeClass( classes.join( " " ) ).addClass( inject_class );
|
||||
})
|
||||
$.ajax({
|
||||
url : _url + mode,
|
||||
data : {"ids" : ids},
|
||||
datatype : "json",
|
||||
})
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
this.minimizeBarManager = function(){
|
||||
var minimizedApps = [],
|
||||
minimizeBar = $("#minimizebar");
|
||||
|
||||
@@ -81,25 +81,26 @@ $(function() {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#dialog").on('show', function (e) {
|
||||
$(this).find('.delete-item').on(clickEvent, function() {
|
||||
var _v = [];
|
||||
$("tbody .list-check").each(function() {
|
||||
this.checked && _v.push("ids[]="+this.value)
|
||||
});
|
||||
var _t = $t.attr("rel");
|
||||
if(_t.indexOf("?") > -1) {
|
||||
$.ajax(_t + "&" + _v.join("&")).done(function() {
|
||||
actionSuccess(_data.checkAction)
|
||||
});
|
||||
} else {
|
||||
$.ajax(_t + "?" + _v.join("&")).done(function() {
|
||||
actionSuccess(_data.checkAction)
|
||||
});
|
||||
$("#dialog").on(clickEvent, '.delete-item', function() {
|
||||
var _v = [],
|
||||
_t = $t.attr("rel");
|
||||
|
||||
$("tbody .list-check:checked").each(function() {
|
||||
_v.push(this.value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url : _t,
|
||||
type:"get",
|
||||
data : {"ids":_v},
|
||||
dataType : "json",
|
||||
success : function(){
|
||||
actionSuccess(_data.checkAction);
|
||||
}
|
||||
$('#dialog').modal('hide');
|
||||
$('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||
e.preventDefault();
|
||||
})
|
||||
});
|
||||
|
||||
$('#dialog').modal('hide');
|
||||
$('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||
})
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user