was.wm.js

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 8  →  ?path2? @ 9
/trunk/dist/was.wm.js
@@ -6138,90 +6138,11 @@
return init(function () {});
}));
 
class wasWM {
constructor(path) {
// Window manager windows.
interact('.window-manager-window')
.draggable({
// enable inertial throwing
inertia: true,
// 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 }
},
// enable autoScroll
autoScroll: true,
onmove: wasWM.dragMoveListener,
onend: function (event) {
event.target.style.opacity = 1;
},
onstart: function(event) {
// Move windows to top on drag.
event.target.style.zIndex = wasWM.getTopWindowIndex() + 1;
event.target.style.opacity = 0.5;
}
})
.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: [
//createSnapGrid({ x: 64, y: 64 })
],
range: Infinity,
relativePoints: [ { x: 0, y: 0 } ]
},
// enable autoScroll
autoScroll: true,
onmove: wasWM.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) {
var wm = $('#' + $(this).data('target'));
wm.fadeOut(750, function() {
wm.remove();
});
});
 
// Windows clicking brings to front.
$(document).on('click', '.window-manager-window', function(event) {
$(event.target)
.closest('.window-manager-window')
.css('z-index', wasWM.getTopWindowIndex() + 1);
});
 
// this is used later in the resizing and gesture demos
window.dragMoveListener = wasWM.dragMoveListener;
 
// Load the window manager icons.
return wasWM.loadWindowManagerIcons(path);
}
 
class wasWM {
// Load the window manager desktop icons.
static loadWindowManagerIcons(path) {
loadWindowManagerIcons(path) {
// Reset the current icon store.
var wasWM = this;
wasWM.icons = [];
// Search and load all nucleons.
$.get(path, function(nucleons) {
@@ -6415,9 +6336,90 @@
Cookies.set('window-manager-icons', states, { path: '' });
}
}
constructor(path) {
this.icons = [];
// Window manager windows.
interact('.window-manager-window')
.draggable({
// enable inertial throwing
inertia: true,
// 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 }
},
// enable autoScroll
autoScroll: true,
onmove: wasWM.dragMoveListener,
onend: function (event) {
event.target.style.opacity = 1;
},
onstart: function(event) {
// Move windows to top on drag.
event.target.style.zIndex = wasWM.getTopWindowIndex() + 1;
event.target.style.opacity = 0.5;
}
})
.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: [
//createSnapGrid({ x: 64, y: 64 })
],
range: Infinity,
relativePoints: [ { x: 0, y: 0 } ]
},
// enable autoScroll
autoScroll: true,
onmove: wasWM.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) {
var wm = $('#' + $(this).data('target'));
wm.fadeOut(750, function() {
wm.remove();
});
});
 
// Windows clicking brings to front.
$(document).on('click', '.window-manager-window', function(event) {
$(event.target)
.closest('.window-manager-window')
.css('z-index', wasWM.getTopWindowIndex() + 1);
});
 
// this is used later in the resizing and gesture demos
window.dragMoveListener = wasWM.dragMoveListener;
 
// Load the window manager icons.
this.loadWindowManagerIcons(path);
}
}
 
// Stores icons.
wasWM.icons = [];
wasWM.prototype.icons = [];