uploader v0.1
This commit is contained in:
@@ -166,6 +166,13 @@ class Spot extends Main
|
|||||||
|
|
||||||
return self::getJsonResult($bSuccess, $sDesc, $asMessages);
|
return self::getJsonResult($bSuccess, $sDesc, $asMessages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function upload()
|
||||||
|
{
|
||||||
|
$this->oClassManagement->incClass('uploader', true);
|
||||||
|
$oUploader = new Uploader();
|
||||||
|
return $oUploader->getBody();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
1409
inc/uploader.php
Normal file
1409
inc/uploader.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -30,6 +30,9 @@ if($sAction!='')
|
|||||||
case 'messages':
|
case 'messages':
|
||||||
$sResult = $oSpot->getMessages();
|
$sResult = $oSpot->getMessages();
|
||||||
break;
|
break;
|
||||||
|
case 'upload':
|
||||||
|
$sResult = $oSpot->upload();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$sResult = Spot::getJsonResult(false, Spot::NOT_FOUND);
|
$sResult = Spot::getJsonResult(false, Spot::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -65,7 +65,6 @@ oSpot.pageInit = function(asHash)
|
|||||||
{
|
{
|
||||||
mouseover: function(marker, event, context)
|
mouseover: function(marker, event, context)
|
||||||
{
|
{
|
||||||
console.log('over');
|
|
||||||
var map = $(this).gmap3("get"), infowindow = $(this).gmap3({get:{name:"infowindow"}});
|
var map = $(this).gmap3("get"), infowindow = $(this).gmap3({get:{name:"infowindow"}});
|
||||||
if(infowindow)
|
if(infowindow)
|
||||||
{
|
{
|
||||||
|
|||||||
28
masks/upload.html
Normal file
28
masks/upload.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<div id="messages">
|
||||||
|
<input id="fileupload" type="file" name="files[]" multiple>
|
||||||
|
<div id="progress">
|
||||||
|
<div class="bar" style="width: 0%;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
oSpot.pageInit = function(asHash)
|
||||||
|
{
|
||||||
|
$('#fileupload')
|
||||||
|
.attr('data-url', self.getActionLink('upload'))
|
||||||
|
.fileupload({
|
||||||
|
dataType: 'json',
|
||||||
|
done: function (e, data) {
|
||||||
|
$.each(data.result.files, function (index, file) {
|
||||||
|
$('<p/>').text(file.name).appendTo(document.body);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
progressall: function (e, data) {
|
||||||
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
$('#progress .bar').css(
|
||||||
|
'width',
|
||||||
|
progress + '%'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
File diff suppressed because one or more lines are too long
@@ -131,6 +131,17 @@ function Spot(asGlobals)
|
|||||||
|
|
||||||
/* Page Switch - DOM Replacement */
|
/* Page Switch - DOM Replacement */
|
||||||
|
|
||||||
|
this.getActionLink = function(sAction, oVars)
|
||||||
|
{
|
||||||
|
if(!oVars) oVars = {};
|
||||||
|
sVars = '';
|
||||||
|
for(i in oVars)
|
||||||
|
{
|
||||||
|
sVars += '&'+i+'='+oVars[i];
|
||||||
|
}
|
||||||
|
return self.consts.process_page+'?a='+sAction+sVars;
|
||||||
|
};
|
||||||
|
|
||||||
this.resetTmpFunctions = function()
|
this.resetTmpFunctions = function()
|
||||||
{
|
{
|
||||||
self.pageInit = function(asHash){console.log('no init for the page: '+asHash.page)};
|
self.pageInit = function(asHash){console.log('no init for the page: '+asHash.page)};
|
||||||
|
|||||||
@@ -43,3 +43,10 @@
|
|||||||
.info-window .battery {
|
.info-window .battery {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Upload */
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
height: 18px;
|
||||||
|
background: green;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user