Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
b5ea20ac86
@ -173,7 +173,7 @@ class Ping extends \Zotlabs\Web\Controller {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'all_events':
|
case 'all_events':
|
||||||
$r = q("update event set `dimissed` = 1 where `dismissed` = 0 and uid = %d AND dtstart < '%s' AND dtstart > '%s' ",
|
$r = q("update event set `dismissed` = 1 where `dismissed` = 0 and uid = %d AND dtstart < '%s' AND dtstart > '%s' ",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')),
|
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')),
|
||||||
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days'))
|
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days'))
|
||||||
|
@ -58,7 +58,8 @@ class Ratingsearch extends \Zotlabs\Web\Controller {
|
|||||||
$ret['success'] = true;
|
$ret['success'] = true;
|
||||||
|
|
||||||
$r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash
|
$r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash
|
||||||
where xlink_link = '%s' and xlink_rating != 0 and xlink_static = 1 and xchan_orphan = 0 and xchan_deleted = 0
|
where xlink_link = '%s' and xlink_rating != 0 and xlink_static = 1
|
||||||
|
and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
|
||||||
order by xchan_name asc",
|
order by xchan_name asc",
|
||||||
dbesc($target)
|
dbesc($target)
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
namespace Zotlabs\Module;
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Rmagic extends \Zotlabs\Web\Controller {
|
class Rmagic extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
@ -32,18 +31,6 @@ class Rmagic extends \Zotlabs\Web\Controller {
|
|||||||
$arr = array('address' => $address);
|
$arr = array('address' => $address);
|
||||||
call_hooks('reverse_magic_auth', $arr);
|
call_hooks('reverse_magic_auth', $arr);
|
||||||
|
|
||||||
try {
|
|
||||||
require_once('library/openid/openid.php');
|
|
||||||
$openid = new \LightOpenID(z_root());
|
|
||||||
$openid->identity = $address;
|
|
||||||
$openid->returnUrl = z_root() . '/openid';
|
|
||||||
$openid->required = array('namePerson/friendly', 'namePerson');
|
|
||||||
$openid->optional = array('namePerson/first','media/image/aspect11','media/image/default');
|
|
||||||
goaway($openid->authUrl());
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.').'<br /><br >'. t('The error message was:').' '.$e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
// if they're still here...
|
// if they're still here...
|
||||||
notice( t('Authentication failed.') . EOL);
|
notice( t('Authentication failed.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -69,81 +69,6 @@ class Browser extends DAV\Browser\Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Extend from parent to add our own listeners
|
|
||||||
*/
|
|
||||||
function initialize(DAV\Server $server) {
|
|
||||||
parent::initialize($server);
|
|
||||||
if ($this->enablePost) {
|
|
||||||
$this->server->on('onBrowserPostAction', [$this, 'cloudPostAction']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles POST requests for tree operations.
|
|
||||||
*
|
|
||||||
* @param string $uri
|
|
||||||
* @param string $action
|
|
||||||
* @param array $postVars
|
|
||||||
* @return boolean false will stop other events in the beforeMethod chain to execute
|
|
||||||
*/
|
|
||||||
function cloudPostAction($uri, $action, $postVars) {
|
|
||||||
switch ($postVars['sabreAction']) {
|
|
||||||
case 'mkcol' :
|
|
||||||
if (isset($postVars['name']) && trim($postVars['name'])) {
|
|
||||||
// Using basename() because we won't allow slashes
|
|
||||||
list(, $folderName) = \Sabre\HTTP\URLUtil::splitPath(trim($postVars['name']));
|
|
||||||
|
|
||||||
if (isset($postVars['resourceType'])) {
|
|
||||||
$resourceType = explode(',', $postVars['resourceType']);
|
|
||||||
} else {
|
|
||||||
$resourceType = ['{DAV:}collection'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$properties = [];
|
|
||||||
foreach ($postVars as $varName => $varValue) {
|
|
||||||
// Any _POST variable in clark notation is treated
|
|
||||||
// like a property.
|
|
||||||
if ($varName[0] === '{') {
|
|
||||||
// PHP will convert any dots to underscores.
|
|
||||||
// This leaves us with no way to differentiate
|
|
||||||
// the two.
|
|
||||||
// Therefore we replace the string *DOT* with a
|
|
||||||
// real dot. * is not allowed in uris so we
|
|
||||||
// should be good.
|
|
||||||
$varName = str_replace('*DOT*', '.', $varName);
|
|
||||||
$properties[$varName] = $varValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$mkCol = new DAV\MkCol(
|
|
||||||
$resourceType,
|
|
||||||
$properties
|
|
||||||
);
|
|
||||||
$this->server->createCollection($uri . '/' . $folderName, $mkCol);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'put' :
|
|
||||||
|
|
||||||
if ($_FILES)
|
|
||||||
$file = current($_FILES);
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
for ($i = 0; $i < count($file['name']); $i++) {
|
|
||||||
list(, $newName) = \Sabre\HTTP\URLUtil::splitPath(trim($file['name'][$i]));
|
|
||||||
|
|
||||||
if (is_uploaded_file($file['tmp_name'][$i])) {
|
|
||||||
$this->server->createFile($uri . '/' . $newName, fopen($file['tmp_name'][$i], 'r'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates the directory listing for the given path.
|
* @brief Creates the directory listing for the given path.
|
||||||
*
|
*
|
||||||
|
@ -13,7 +13,7 @@ require_once('include/api_auth.php');
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Red API. Loosely based on and possibly compatible with a Twitter-Like API but all similarities end there.
|
* Hubzilla API. Loosely based on and possibly compatible with Twitter-Like (v1.0) API but all similarities end there.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ function z_mime_content_type($filename) {
|
|||||||
// 'webm' => 'audio/webm',
|
// 'webm' => 'audio/webm',
|
||||||
'mp4' => 'video/mp4',
|
'mp4' => 'video/mp4',
|
||||||
// 'mp4' => 'audio/mp4',
|
// 'mp4' => 'audio/mp4',
|
||||||
|
'mkv' => 'video/x-matroska',
|
||||||
|
|
||||||
// adobe
|
// adobe
|
||||||
'pdf' => 'application/pdf',
|
'pdf' => 'application/pdf',
|
||||||
|
@ -2608,32 +2608,33 @@ function getIconFromType($type) {
|
|||||||
'application/octet-stream' => 'fa-file-o',
|
'application/octet-stream' => 'fa-file-o',
|
||||||
//Text
|
//Text
|
||||||
'text/plain' => 'fa-file-text-o',
|
'text/plain' => 'fa-file-text-o',
|
||||||
'application/msword' => 'fa-file-text-o',
|
'application/msword' => 'fa-file-word-o',
|
||||||
'application/pdf' => 'fa-file-text-o',
|
'application/pdf' => 'fa-file-pdf-o',
|
||||||
'application/vnd.oasis.opendocument.text' => 'fa-file-text-o',
|
'application/vnd.oasis.opendocument.text' => 'fa-file-word-o',
|
||||||
'application/epub+zip' => 'fa-book',
|
'application/epub+zip' => 'fa-book',
|
||||||
//Spreadsheet
|
//Spreadsheet
|
||||||
'application/vnd.oasis.opendocument.spreadsheet' => 'fa-table',
|
'application/vnd.oasis.opendocument.spreadsheet' => 'fa-file-excel-o',
|
||||||
'application/vnd.ms-excel' => 'fa-table',
|
'application/vnd.ms-excel' => 'fa-file-excel-o',
|
||||||
//Image
|
//Image
|
||||||
'image/jpeg' => 'fa-picture-o',
|
'image/jpeg' => 'fa-picture-o',
|
||||||
'image/png' => 'fa-picture-o',
|
'image/png' => 'fa-picture-o',
|
||||||
'image/gif' => 'fa-picture-o',
|
'image/gif' => 'fa-picture-o',
|
||||||
'image/svg+xml' => 'fa-picture-o',
|
'image/svg+xml' => 'fa-picture-o',
|
||||||
//Archive
|
//Archive
|
||||||
'application/zip' => 'fa-archive',
|
'application/zip' => 'fa-file-archive-o',
|
||||||
'application/x-rar-compressed' => 'fa-archive',
|
'application/x-rar-compressed' => 'fa-file-archive-o',
|
||||||
//Audio
|
//Audio
|
||||||
'audio/mpeg' => 'fa-music',
|
'audio/mpeg' => 'fa-file-audio-o',
|
||||||
'audio/wav' => 'fa-music',
|
'audio/wav' => 'fa-file-audio-o',
|
||||||
'application/ogg' => 'fa-music',
|
'application/ogg' => 'fa-file-audio-o',
|
||||||
'audio/ogg' => 'fa-music',
|
'audio/ogg' => 'fa-file-audio-o',
|
||||||
'audio/webm' => 'fa-music',
|
'audio/webm' => 'fa-file-audio-o',
|
||||||
'audio/mp4' => 'fa-music',
|
'audio/mp4' => 'fa-file-audio-o',
|
||||||
//Video
|
//Video
|
||||||
'video/quicktime' => 'fa-film',
|
'video/quicktime' => 'fa-file-video-o',
|
||||||
'video/webm' => 'fa-film',
|
'video/webm' => 'fa-file-video-o',
|
||||||
'video/mp4' => 'fa-film'
|
'video/mp4' => 'fa-file-video-o',
|
||||||
|
'video/x-matroska' => 'fa-file-video-o'
|
||||||
);
|
);
|
||||||
|
|
||||||
$iconFromType = 'fa-file-o';
|
$iconFromType = 'fa-file-o';
|
||||||
|
@ -159,7 +159,7 @@ class ASN_BASE {
|
|||||||
}
|
}
|
||||||
$length = $tempLength;
|
$length = $tempLength;
|
||||||
}
|
}
|
||||||
$data = substr($string, $p, $length);
|
$data = substr($string, $p, intval($length));
|
||||||
$parsed[] = self::parseASNData($type, $data, $level, $maxLevels);
|
$parsed[] = self::parseASNData($type, $data, $level, $maxLevels);
|
||||||
$p = $p + $length;
|
$p = $p + $length;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function po2php_run($argc,$argv) {
|
function po2php_run($argc,$argv) {
|
||||||
|
|
||||||
if ($argc < 2) {
|
if ($argc < 2) {
|
||||||
@ -59,8 +58,9 @@ function po2php_run($argc,$argv) {
|
|||||||
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";
|
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";
|
||||||
$out .= ' return '.$cond.';'."\n";
|
$out .= ' return '.$cond.';'."\n";
|
||||||
$out .= '}}'."\n";
|
$out .= '}}'."\n";
|
||||||
|
|
||||||
|
$out .= 'App::$rtl = ' . intval($rtl) ;
|
||||||
}
|
}
|
||||||
$out .= 'App::$rtl = ' . intval($rtl) . ';';
|
|
||||||
|
|
||||||
if ($k!="" && substr($l,0,7)=="msgstr "){
|
if ($k!="" && substr($l,0,7)=="msgstr "){
|
||||||
if ($ink) { $ink = False; $out .= 'App::$strings["'.$k.'"] = '; }
|
if ($ink) { $ink = False; $out .= 'App::$strings["'.$k.'"] = '; }
|
||||||
|
@ -41,12 +41,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#profile-jot-text.hover {
|
#profile-jot-text.hover {
|
||||||
color: #f00;
|
background-color: aliceblue;
|
||||||
background-color: #43488A;
|
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
border-color: #f00;
|
box-shadow: inset 0 0px 7px #5cb85c;
|
||||||
border-style: solid;
|
|
||||||
box-shadow: inset 0 3px 4px #888;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jot-attachment {
|
.jot-attachment {
|
||||||
|
@ -41,3 +41,16 @@
|
|||||||
padding: 7px 10px;
|
padding: 7px 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cloud-drag-area.hover {
|
||||||
|
background-color: aliceblue;
|
||||||
|
opacity: 0.5;
|
||||||
|
box-shadow: inset 0 0px 7px #5cb85c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-progress-bar {
|
||||||
|
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOM2RFTDwAE2QHxFMHIIwAAAABJRU5ErkJggg==') repeat-y;
|
||||||
|
background-size: 0px;
|
||||||
|
padding: 0px !important;
|
||||||
|
height: 3px;
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4623
view/it/hstrings.php
4623
view/it/hstrings.php
File diff suppressed because it is too large
Load Diff
@ -5,94 +5,212 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
// call initialization file
|
// call initialization file
|
||||||
if (window.File && window.FileList && window.FileReader) {
|
if (window.File && window.FileList && window.FileReader) {
|
||||||
DragDropUploadInit();
|
UploadInit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
// initialize
|
// initialize
|
||||||
function DragDropUploadInit() {
|
function UploadInit() {
|
||||||
|
|
||||||
var fileselect = $("#fileselect"),
|
var fileselect = $("#files-upload");
|
||||||
filedrag = $("#filedrag");
|
var filedrag = $("#cloud-drag-area");
|
||||||
|
var submit = $("#upload-submit");
|
||||||
// file select
|
|
||||||
fileselect.on("change", DragDropUploadFileSelectHandler);
|
|
||||||
|
|
||||||
// is XHR2 available?
|
// is XHR2 available?
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
if (xhr.upload) {
|
if (xhr.upload) {
|
||||||
|
|
||||||
|
// file select
|
||||||
|
fileselect.attr("multiple", 'multiple');
|
||||||
|
fileselect.on("change", UploadFileSelectHandler);
|
||||||
|
|
||||||
|
// file submit
|
||||||
|
submit.on("click", fileselect, UploadFileSelectHandler);
|
||||||
|
|
||||||
// file drop
|
// file drop
|
||||||
filedrag.on("dragover", DragDropUploadFileHover);
|
filedrag.on("dragover", DragDropUploadFileHover);
|
||||||
filedrag.on("dragleave", DragDropUploadFileHover);
|
filedrag.on("dragleave", DragDropUploadFileHover);
|
||||||
filedrag.on("drop", DragDropUploadFileSelectHandler);
|
filedrag.on("drop", DragDropUploadFileSelectHandler);
|
||||||
filedrag.show();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.filesToUpload = 0;
|
window.filesToUpload = 0;
|
||||||
window.fileUploadsCompleted = 0;
|
window.fileUploadsCompleted = 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// file drag hover
|
// file drag hover
|
||||||
function DragDropUploadFileHover(e) {
|
function DragDropUploadFileHover(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.target.className = (e.type == "dragover" ? "hover" : "");
|
e.currentTarget.className = (e.type == "dragover" ? "hover" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// file selection
|
// file selection via drag/drop
|
||||||
function DragDropUploadFileSelectHandler(e) {
|
function DragDropUploadFileSelectHandler(e) {
|
||||||
|
|
||||||
// cancel event and hover styling
|
// cancel event and hover styling
|
||||||
DragDropUploadFileHover(e);
|
DragDropUploadFileHover(e);
|
||||||
|
|
||||||
// fetch FileList object
|
// fetch FileList object
|
||||||
var files = e.target.files || e.originalEvent.dataTransfer.files;
|
var files = e.target.files || e.originalEvent.dataTransfer.files;
|
||||||
$("#file-upload-list").empty();
|
|
||||||
|
$('.new-upload').remove();
|
||||||
|
|
||||||
// process all File objects
|
// process all File objects
|
||||||
for (var i = 0, f; f = files[i]; i++) {
|
for (var i = 0, f; f = files[i]; i++) {
|
||||||
$("#file-upload-list").append(
|
prepareHtml(f, i);
|
||||||
"<p>" + "<span id='upload-progress-" + i + "'></span> -> File: <strong>" + f.name +
|
UploadFile(f, i);
|
||||||
"</strong> type: <strong>" + f.type +
|
}
|
||||||
"</strong> size: <strong>" + f.size +
|
|
||||||
"</strong> bytes</p>"
|
|
||||||
);
|
|
||||||
DragDropUploadFile(f, i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// file selection via input
|
||||||
|
function UploadFileSelectHandler(e) {
|
||||||
|
// fetch FileList object
|
||||||
|
if(e.target.id === 'upload-submit') {
|
||||||
|
e.preventDefault();
|
||||||
|
var files = e.data[0].files;
|
||||||
|
}
|
||||||
|
if(e.target.id === 'files-upload') {
|
||||||
|
$('.new-upload').remove();
|
||||||
|
var files = e.target.files;
|
||||||
|
}
|
||||||
|
|
||||||
|
// process all File objects
|
||||||
|
for (var i = 0, f; f = files[i]; i++) {
|
||||||
|
if(e.target.id === 'files-upload')
|
||||||
|
prepareHtml(f, i);
|
||||||
|
if(e.target.id === 'upload-submit') {
|
||||||
|
UploadFile(f, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function prepareHtml(f, i) {
|
||||||
|
var num = i - 1;
|
||||||
|
$('#cloud-index #new-upload-progress-bar-' + num.toString()).after(
|
||||||
|
'<tr id="new-upload-' + i + '" class="new-upload">' +
|
||||||
|
'<td><i class="fa ' + getIconFromType(f.type) + '" title="' + f.type + '"></i></td>' +
|
||||||
|
'<td>' + f.name + '</td>' +
|
||||||
|
'<td id="upload-progress-' + i + '"></td><td></td><td></td><td></td><td></td>' +
|
||||||
|
'<td class="hidden-xs">' + formatSizeUnits(f.size) + '</td><td class="hidden-xs"></td>' +
|
||||||
|
'</tr>' +
|
||||||
|
'<tr id="new-upload-progress-bar-' + i + '" class="new-upload">' +
|
||||||
|
'<td id="upload-progress-bar-' + i + '" colspan="9" class="upload-progress-bar"></td>' +
|
||||||
|
'</tr>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatSizeUnits(bytes){
|
||||||
|
if (bytes>=1000000000) {bytes=(bytes/1000000000).toFixed(2)+' GB';}
|
||||||
|
else if (bytes>=1000000) {bytes=(bytes/1000000).toFixed(2)+' MB';}
|
||||||
|
else if (bytes>=1000) {bytes=(bytes/1000).toFixed(2)+' KB';}
|
||||||
|
else if (bytes>1) {bytes=bytes+' bytes';}
|
||||||
|
else if (bytes==1) {bytes=bytes+' byte';}
|
||||||
|
else {bytes='0 byte';}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is basically a js port of include/text.php getIconFromType() function
|
||||||
|
function getIconFromType(type) {
|
||||||
|
var map = {
|
||||||
|
//Common file
|
||||||
|
'application/octet-stream': 'fa-file-o',
|
||||||
|
//Text
|
||||||
|
'text/plain': 'fa-file-text-o',
|
||||||
|
'application/msword': 'fa-file-word-o',
|
||||||
|
'application/pdf': 'fa-file-pdf-o',
|
||||||
|
'application/vnd.oasis.opendocument.text': 'fa-file-word-o',
|
||||||
|
'application/epub+zip': 'fa-book',
|
||||||
|
//Spreadsheet
|
||||||
|
'application/vnd.oasis.opendocument.spreadsheet': 'fa-file-excel-o',
|
||||||
|
'application/vnd.ms-excel': 'fa-file-excel-o',
|
||||||
|
//Image
|
||||||
|
'image/jpeg': 'fa-picture-o',
|
||||||
|
'image/png': 'fa-picture-o',
|
||||||
|
'image/gif': 'fa-picture-o',
|
||||||
|
'image/svg+xml': 'fa-picture-o',
|
||||||
|
//Archive
|
||||||
|
'application/zip': 'fa-file-archive-o',
|
||||||
|
'application/x-rar-compressed': 'fa-file-archive-o',
|
||||||
|
//Audio
|
||||||
|
'audio/mpeg': 'fa-file-audio-o',
|
||||||
|
'audio/mp3': 'fa-file-audio-o', //webkit browsers need that
|
||||||
|
'audio/wav': 'fa-file-audio-o',
|
||||||
|
'application/ogg': 'fa-file-audio-o',
|
||||||
|
'audio/ogg': 'fa-file-audio-o',
|
||||||
|
'audio/webm': 'fa-file-audio-o',
|
||||||
|
'audio/mp4': 'fa-file-audio-o',
|
||||||
|
//Video
|
||||||
|
'video/quicktime': 'fa-file-video-o',
|
||||||
|
'video/webm': 'fa-file-video-o',
|
||||||
|
'video/mp4': 'fa-file-video-o',
|
||||||
|
'video/x-matroska': 'fa-file-video-o'
|
||||||
|
};
|
||||||
|
|
||||||
|
var iconFromType = 'fa-file-o';
|
||||||
|
|
||||||
|
if (type in map) {
|
||||||
|
iconFromType = map[type];
|
||||||
|
}
|
||||||
|
|
||||||
|
return iconFromType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// upload files
|
// upload files
|
||||||
function DragDropUploadFile(file, idx) {
|
function UploadFile(file, idx) {
|
||||||
|
|
||||||
window.filesToUpload = window.filesToUpload + 1;
|
window.filesToUpload = window.filesToUpload + 1;
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
xhr.withCredentials = true; // Include the SESSION cookie info for authentication
|
xhr.withCredentials = true; // Include the SESSION cookie info for authentication
|
||||||
|
|
||||||
(xhr.upload || xhr).addEventListener('progress', function (e) {
|
(xhr.upload || xhr).addEventListener('progress', function (e) {
|
||||||
|
|
||||||
var done = e.position || e.loaded;
|
var done = e.position || e.loaded;
|
||||||
var total = e.totalSize || e.total;
|
var total = e.totalSize || e.total;
|
||||||
// Dynamically update the percentage complete displayed in the file upload list
|
// Dynamically update the percentage complete displayed in the file upload list
|
||||||
$('#upload-progress-' + idx).html(Math.round(done / total * 100) + '%');
|
$('#upload-progress-' + idx).html(Math.round(done / total * 100) + '%');
|
||||||
|
$('#upload-progress-bar-' + idx).css('background-size', Math.round(done / total * 100) + '%');
|
||||||
|
|
||||||
|
if(done == total) {
|
||||||
|
$('#upload-progress-' + idx).html('Processing...');
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
xhr.addEventListener('load', function (e) {
|
xhr.addEventListener('load', function (e) {
|
||||||
|
//we could possibly turn the filenames to real links here and add the delete and edit buttons to avoid page reload...
|
||||||
|
$('#upload-progress-' + idx).html('Ready!');
|
||||||
|
|
||||||
//console.log('xhr upload complete', e);
|
//console.log('xhr upload complete', e);
|
||||||
window.fileUploadsCompleted = window.fileUploadsCompleted + 1;
|
window.fileUploadsCompleted = window.fileUploadsCompleted + 1;
|
||||||
|
|
||||||
// When all the uploads have completed, refresh the page
|
// When all the uploads have completed, refresh the page
|
||||||
if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) {
|
if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) {
|
||||||
|
|
||||||
window.fileUploadsCompleted = window.filesToUpload = 0;
|
window.fileUploadsCompleted = window.filesToUpload = 0;
|
||||||
|
|
||||||
// After uploads complete, refresh browser window to display new files
|
// After uploads complete, refresh browser window to display new files
|
||||||
window.location.href = window.location.href;
|
window.location.href = window.location.href;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
xhr.addEventListener('error', function (e) {
|
||||||
|
$('#upload-progress-' + idx).html('<span style="color: red;">ERROR</span>');
|
||||||
|
});
|
||||||
|
|
||||||
// POST to the entire cloud path
|
// POST to the entire cloud path
|
||||||
xhr.open('post', window.location.pathname, true);
|
xhr.open('post', window.location.pathname, true);
|
||||||
|
|
||||||
var data = new FormData(document.getElementById("ajax-upload-files"));
|
var formfields = $("#ajax-upload-files").serializeArray();
|
||||||
data.append('file[]', file);
|
|
||||||
|
var data = new FormData();
|
||||||
|
$.each(formfields, function(i, field) {
|
||||||
|
data.append(field.name, field.value);
|
||||||
|
});
|
||||||
|
data.append('file', file);
|
||||||
|
|
||||||
xhr.send(data);
|
xhr.send(data);
|
||||||
}
|
}
|
||||||
|
@ -2042,24 +2042,3 @@ dl.bb-dl > dd > li {
|
|||||||
#wiki-preview img {
|
#wiki-preview img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#filedrag
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1em 0;
|
|
||||||
margin: 1em 0;
|
|
||||||
color: #555;
|
|
||||||
border: 2px dashed #555;
|
|
||||||
border-radius: 7px;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
#filedrag.hover
|
|
||||||
{
|
|
||||||
color: #f00;
|
|
||||||
border-color: #f00;
|
|
||||||
border-style: solid;
|
|
||||||
box-shadow: inset 0 3px 4px #888;
|
|
||||||
}
|
|
||||||
|
@ -11,16 +11,10 @@
|
|||||||
{{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{$quota.desc}}</div>{{/if}}
|
{{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{$quota.desc}}</div>{{/if}}
|
||||||
<form id="ajax-upload-files" method="post" action="" enctype="multipart/form-data">
|
<form id="ajax-upload-files" method="post" action="" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="sabreAction" value="put">
|
<input type="hidden" name="sabreAction" value="put">
|
||||||
<div>
|
|
||||||
<div id="filedrag" style="height: 7em;"><br>{{$dragdroptext}}</div>
|
|
||||||
</div>
|
|
||||||
<div id="file-upload-list"></div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<label for="files-upload">{{$upload_header}}</label>
|
<label for="files-upload">{{$upload_header}}</label>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<input class="form-group pull-left" id="files-upload" type="file" name="file[]" multiple>
|
<input class="form-group pull-left" id="files-upload" type="file" name="file">
|
||||||
<button class="btn btn-primary btn-sm pull-right" type="submit" value="{{$upload_submit}}">{{$upload_submit}}</button>
|
<button id="upload-submit" class="btn btn-primary btn-sm pull-right" type="submit" value="{{$upload_submit}}">{{$upload_submit}}</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<hr/>
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="section-content-wrapper-np">
|
<div id="cloud-drag-area" class="section-content-wrapper-np">
|
||||||
<table id="cloud-index">
|
<table id="cloud-index">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="1%"></th>
|
<th width="1%"></th>
|
||||||
@ -18,6 +18,7 @@
|
|||||||
<td class="hidden-xs"></td>
|
<td class="hidden-xs"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<tr id="new-upload-progress-bar--1"></tr> {{* this is needed to append the upload files in the right order *}}
|
||||||
{{foreach $entries as $item}}
|
{{foreach $entries as $item}}
|
||||||
<tr id="cloud-index-{{$item.attachId}}">
|
<tr id="cloud-index-{{$item.attachId}}">
|
||||||
<td><i class="fa {{$item.iconFromType}}" title="{{$item.type}}"></i></td>
|
<td><i class="fa {{$item.iconFromType}}" title="{{$item.type}}"></i></td>
|
||||||
@ -38,6 +39,7 @@
|
|||||||
<tr id="cloud-tools-{{$item.attachId}}">
|
<tr id="cloud-tools-{{$item.attachId}}">
|
||||||
<td id="perms-panel-{{$item.attachId}}" colspan="9"></td>
|
<td id="perms-panel-{{$item.attachId}}" colspan="9"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -511,10 +511,10 @@ function enableOnUser(){
|
|||||||
xhr.addEventListener('load', function (e) {
|
xhr.addEventListener('load', function (e) {
|
||||||
//console.log('xhr upload complete', e);
|
//console.log('xhr upload complete', e);
|
||||||
window.fileUploadsCompleted = window.fileUploadsCompleted + 1;
|
window.fileUploadsCompleted = window.fileUploadsCompleted + 1;
|
||||||
// When all the uploads have completed, refresh the page
|
|
||||||
if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) {
|
|
||||||
addeditortext(xhr.responseText);
|
addeditortext(xhr.responseText);
|
||||||
$('#jot-media').val($('#jot-media').val() + xhr.responseText);
|
$('#jot-media').val($('#jot-media').val() + xhr.responseText);
|
||||||
|
// When all the uploads have completed, refresh the page
|
||||||
|
if (window.filesToUpload > 0 && window.fileUploadsCompleted === window.filesToUpload) {
|
||||||
$('#profile-rotator').spin(false);
|
$('#profile-rotator').spin(false);
|
||||||
window.fileUploadsCompleted = window.filesToUpload = 0;
|
window.fileUploadsCompleted = window.filesToUpload = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user