corrade-nucleus-nucleons

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 29  →  ?path2? @ 30
/base/000_base/js/nucleus/load-nucleons.js
@@ -3,24 +3,24 @@
if($('#' + nucleon).length)
return;
// Change the nucleon icon to a loading icon.
$('#' + nucleon + '-button-icon').attr('src', '/img/loader.gif');
// Disable button for successive clicks.
$('#' + nucleon + '-button').prop('disabled', true);
// Change the nucleon icon to a loading icon.
$('#' + nucleon + '-icon').attr('src', '/img/loader.svg');
// Load the nucleon.
$.get('/' + nucleon + '/index.html', function(data) {
$('#nucleons-container').append(data);
$('#window-manager-desktop').append(data);
}).done(function(data) {
// Change the nucleon icon back.
$('#' + nucleon + '-icon').attr('src', '/' + nucleon + '/img/' + nucleon + '.png');
$('#' + nucleon + '-button-icon').attr('src', '/' + nucleon + '/img/' + nucleon + '.png');
// Enable the button.
$('#' + nucleon + '-button').prop('disabled', false);
});
}
 
// Generate the nucleon selectors.
// Generate the nucleon icons on the desktop.
$(document).ready(function() {
// Search and load all nucleons.
$.get('/nucleons', function(data) {
@@ -29,8 +29,8 @@
// Skip files starting with full stop (POSIX).
if (/^\./.test(value)) return;
$.get('/nucleons/' + value, function(doc) {
var div = $('<div class="col-xs-6 col-md-3">').html(doc);
$('#nucleons').append(div);
//var div = $('<div class="col-xs-6 col-md-3">').html(doc);
$('#window-manager-desktop').append(doc);
});
});
});
/base/000_base/js/wm/wm.js
@@ -3,7 +3,7 @@
return Math.max.apply(null,
$.map($('.window-manager-window'), function(e, n) {
if ($(e).css('position') != 'static')
return parseInt($(e).css('z-index')) || 1;
return parseInt($(e).css('z-index')) || 2;
})
);
}
@@ -36,6 +36,36 @@
}
})
.allowFrom('.panel-heading');
// Window manager icons.
interact('.window-manager-icon')
.draggable({
// enable inertial throwing
inertia: false,
// keep the element within the area of it's parent
restrict: {
restriction: $('#window-manager-desktop').get(0),
endOnly: true,
elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
},
snap: {
targets: [
interact.createSnapGrid({ x: 64, y: 64 })
],
range: Infinity,
relativePoints: [ { x: 0, y: 0 } ]
},
// enable autoScroll
autoScroll: true,
onmove: dragMoveListener,
onend: function (event) {
event.target.style.opacity = 1;
},
onstart: function(event) {
event.target.style.opacity = 0.5;
}
});
 
// Closing windows.
$(document).on('click', '.window-manager-close-button', function(event) {