Compare commits
No commits in common. "0076aae8968c937017cabceb7d748f13c13681a5" and "9c82a18585ed0ac6483a8f0d02a900a9d49215fe" have entirely different histories.
0076aae896
...
9c82a18585
5 changed files with 3 additions and 122 deletions
|
|
@ -69,15 +69,6 @@ pandora.ui.addItemDialog = function(options) {
|
||||||
title: Ox._('Add {0}', [pandora.site.itemName.singular]),
|
title: Ox._('Add {0}', [pandora.site.itemName.singular]),
|
||||||
width: 544
|
width: 544
|
||||||
});
|
});
|
||||||
if (options.files) {
|
|
||||||
that.options({content: $screen.start()});
|
|
||||||
$button.options({disabled: true});
|
|
||||||
Ox.serialMap(options.files, function(file, index, files, callback) {
|
|
||||||
getFileInfo(file, function(info) {
|
|
||||||
callback(Ox.extend(info, {file: file}));
|
|
||||||
});
|
|
||||||
}, onInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createButton() {
|
function createButton() {
|
||||||
$button = Ox[selected == 'upload' ? 'FileButton' : 'Button']({
|
$button = Ox[selected == 'upload' ? 'FileButton' : 'Button']({
|
||||||
|
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
'use strict';
|
|
||||||
|
|
||||||
pandora.ui.importScreen = function() {
|
|
||||||
|
|
||||||
var that = Ox.Element()
|
|
||||||
.attr({id: 'importScreen'})
|
|
||||||
.css({
|
|
||||||
position: 'absolute',
|
|
||||||
left: 0,
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
||||||
zIndex: 1000
|
|
||||||
})
|
|
||||||
.on({
|
|
||||||
click: function() {
|
|
||||||
that.remove();
|
|
||||||
},
|
|
||||||
dragleave: function() {
|
|
||||||
that.remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Ox.Element()
|
|
||||||
.css({
|
|
||||||
position: 'absolute',
|
|
||||||
left: 0,
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
width: pandora.hasCapability('canAddItems') ? 192 : 256,
|
|
||||||
height: 16,
|
|
||||||
padding: '8px 0',
|
|
||||||
borderRadius: 8,
|
|
||||||
margin: 'auto',
|
|
||||||
background: 'rgba(255, 255, 255, 0.9)',
|
|
||||||
fontSize: 13,
|
|
||||||
color: 'rgb(0, 0, 0)',
|
|
||||||
textAlign: 'center'
|
|
||||||
})
|
|
||||||
.text(
|
|
||||||
Ox._(pandora.hasCapability('canAddItems') ? (
|
|
||||||
'Import {0}'
|
|
||||||
) : (
|
|
||||||
'You are not allowed to import {0}'
|
|
||||||
),
|
|
||||||
[pandora.user.ui.section == 'documents' ? 'Documents' : pandora.site.itemName.plural])
|
|
||||||
)
|
|
||||||
.appendTo(that);
|
|
||||||
|
|
||||||
return that;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
@ -281,37 +281,6 @@ appPanel
|
||||||
resize: pandora.resizeWindow,
|
resize: pandora.resizeWindow,
|
||||||
unload: pandora.unloadWindow
|
unload: pandora.unloadWindow
|
||||||
})
|
})
|
||||||
Ox.$document.on({
|
|
||||||
dragenter: function(event) {
|
|
||||||
if (Ox.contains(event.originalEvent.dataTransfer.types, 'Files')) {
|
|
||||||
event.originalEvent.preventDefault();
|
|
||||||
event.originalEvent.stopPropagation();
|
|
||||||
if (!$('#importScreen').length) {
|
|
||||||
pandora.ui.importScreen().appendTo(Ox.$body);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log(event.originalEvent.dataTransfer);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dragover: function(event) {
|
|
||||||
event.originalEvent.preventDefault();
|
|
||||||
event.originalEvent.stopPropagation();
|
|
||||||
},
|
|
||||||
dragstart: function(event) {
|
|
||||||
event.originalEvent.preventDefault();
|
|
||||||
event.originalEvent.stopPropagation();
|
|
||||||
},
|
|
||||||
drop: function(event) {
|
|
||||||
$('#importScreen').remove();
|
|
||||||
if (pandora.hasCapability('canAddItems')) {
|
|
||||||
if (event.originalEvent.dataTransfer.files.length) {
|
|
||||||
event.originalEvent.preventDefault();
|
|
||||||
event.originalEvent.stopPropagation();
|
|
||||||
pandora.uploadDroppedFiles(event.originalEvent.dataTransfer.files)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Ox.extend(pandora, {
|
Ox.extend(pandora, {
|
||||||
$ui: {},
|
$ui: {},
|
||||||
site: data.site,
|
site: data.site,
|
||||||
|
|
|
||||||
|
|
@ -404,31 +404,6 @@ pandora.createLinks = function($element) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
pandora.uploadDroppedFiles = function(files) {
|
|
||||||
var documentExtensions = ['pdf', /* 'epub', 'txt', */ 'png', 'gif', 'jpg'];
|
|
||||||
files = Ox.map(files, function(file) { return file});
|
|
||||||
|
|
||||||
if (files.every(function(file) {
|
|
||||||
var extension = file.name.split('.').pop().toLowerCase()
|
|
||||||
return Ox.contains(documentExtensions, extension)
|
|
||||||
})) {
|
|
||||||
pandora.ui.uploadDocumentDialog({
|
|
||||||
files: files
|
|
||||||
}, function(files) {
|
|
||||||
if (files) {
|
|
||||||
Ox.Request.clearCache('findDocuments');
|
|
||||||
if (pandora.user.ui.document || pandora.user.ui.section != 'documents') {
|
|
||||||
pandora.UI.set({section: 'documents', document: ''});
|
|
||||||
} else {
|
|
||||||
pandora.$ui.list && pandora.$ui.list.reloadList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).open();
|
|
||||||
} else {
|
|
||||||
pandora.ui.addItemDialog({files: files}).open()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
pandora.doHistory = function(action, items, targets, index, callback) {
|
pandora.doHistory = function(action, items, targets, index, callback) {
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ BASE=`pwd`
|
||||||
VERSION=`cd ..;git rev-list HEAD --count`
|
VERSION=`cd ..;git rev-list HEAD --count`
|
||||||
TARGET=${BASE}/pandora-r${VERSION}.vdi
|
TARGET=${BASE}/pandora-r${VERSION}.vdi
|
||||||
|
|
||||||
img=bionic-server-cloudimg-amd64.img
|
img=xenial-server-cloudimg-amd64-disk1.img
|
||||||
|
|
||||||
if [ ! -e $img ]; then
|
if [ ! -e $img ]; then
|
||||||
echo downloading $img
|
echo downloading $img
|
||||||
curl -s -O https://cloud-images.ubuntu.com/bionic/current/$img
|
curl -s -O https://cloud-images.ubuntu.com/xenial/current/$img
|
||||||
fi
|
fi
|
||||||
echo preparing ${TARGET}.img
|
echo preparing ${TARGET}.img
|
||||||
cp -a $img ${TARGET}.img
|
cp -a $img ${TARGET}.img
|
||||||
|
|
@ -19,7 +19,7 @@ qemu-img resize ${TARGET}.img +998G
|
||||||
|
|
||||||
echo boot image and install pandora
|
echo boot image and install pandora
|
||||||
kvm -m 1024 \
|
kvm -m 1024 \
|
||||||
-smp 2 \
|
-smp 4 \
|
||||||
-cdrom seed.img \
|
-cdrom seed.img \
|
||||||
-device e1000,netdev=user.0 \
|
-device e1000,netdev=user.0 \
|
||||||
-netdev user,id=user.0,hostfwd=tcp::5555-:22,hostfwd=tcp::2620-:80 \
|
-netdev user,id=user.0,hostfwd=tcp::5555-:22,hostfwd=tcp::2620-:80 \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue