init uploader (v0.1) + go live spot feed
This commit is contained in:
23
files/.htaccess
Normal file
23
files/.htaccess
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# The following directives prevent the execution of script files
|
||||||
|
# in the context of the website.
|
||||||
|
# They also force the content-type application/octet-stream and
|
||||||
|
# force browsers to display a download dialog for non-image files.
|
||||||
|
SetHandler default-handler
|
||||||
|
ForceType application/octet-stream
|
||||||
|
Header set Content-Disposition attachment
|
||||||
|
|
||||||
|
# The following unsets the forced type and Content-Disposition headers
|
||||||
|
# for known image files:
|
||||||
|
<FilesMatch "(?i)\.(gif|jpe?g|png)$">
|
||||||
|
ForceType none
|
||||||
|
Header unset Content-Disposition
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# The following directive prevents browsers from MIME-sniffing the content-type.
|
||||||
|
# This is an important complement to the ForceType directive above:
|
||||||
|
Header set X-Content-Type-Options nosniff
|
||||||
|
|
||||||
|
# Uncomment the following lines to prevent unauthorized download of files:
|
||||||
|
#AuthName "Authorization required"
|
||||||
|
#AuthType Basic
|
||||||
|
#require valid-user
|
||||||
@@ -80,8 +80,8 @@ class Spot extends Main
|
|||||||
private function getFeed($sRefFeedId=self::FEED_ID)
|
private function getFeed($sRefFeedId=self::FEED_ID)
|
||||||
{
|
{
|
||||||
$sUrl = self::FEED_HOOK.$sRefFeedId.self::FEED_TYPE_JSON;
|
$sUrl = self::FEED_HOOK.$sRefFeedId.self::FEED_TYPE_JSON;
|
||||||
//$sContent = file_get_contents($sUrl);
|
$sContent = file_get_contents($sUrl);
|
||||||
$sContent = '{"response":{"feedMessageResponse":{"count":1,"feed":{"id":"0Y5LrvigElWeAieBGnFol0KBEuOTkFJmm","name":"Te Araroa","description":"Te Araroa","status":"ACTIVE","usage":0,"daysRange":7,"detailedMessageShown":false},"totalCount":1,"activityCount":0,"messages":{"message":{"@clientUnixTime":"0","id":477259564,"messengerId":"0-2489517","messengerName":"Francois","unixTime":1449002345,"messageType":"OK","latitude":48.85129,"longitude":2.40491,"modelId":"SPOT3","showCustomMsg":"N","dateTime":"2015-12-01T20:39:05+0000","messageDetail":"","batteryState":"GOOD","hidden":0,"messageContent":"Jusque là , tout va bien ! Click sur le lien en dessous pour voir où je suis :)\r\n\r\n@Clara: <3"}}}}}';
|
//$sContent = '{"response":{"feedMessageResponse":{"count":1,"feed":{"id":"0Y5LrvigElWeAieBGnFol0KBEuOTkFJmm","name":"Te Araroa","description":"Te Araroa","status":"ACTIVE","usage":0,"daysRange":7,"detailedMessageShown":false},"totalCount":1,"activityCount":0,"messages":{"message":{"@clientUnixTime":"0","id":477259564,"messengerId":"0-2489517","messengerName":"Francois","unixTime":1449002345,"messageType":"OK","latitude":48.85129,"longitude":2.40491,"modelId":"SPOT3","showCustomMsg":"N","dateTime":"2015-12-01T20:39:05+0000","messageDetail":"","batteryState":"GOOD","hidden":0,"messageContent":"Jusque là , tout va bien ! Click sur le lien en dessous pour voir où je suis :)\r\n\r\n@Clara: <3"}}}}}';
|
||||||
return json_decode($sContent, true);
|
return json_decode($sContent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,17 @@ class Uploader extends UploadHandler
|
|||||||
{
|
{
|
||||||
private $sBody;
|
private $sBody;
|
||||||
|
|
||||||
function __construct($asOptions = null, $bInitialize = true, $asErrorMessages = null)
|
function __construct($asOptions = null, $bInitialize = false, $asErrorMessages = null)
|
||||||
{
|
{
|
||||||
parent::__construct($asOptions, $bInitialize, $asErrorMessages);
|
parent::__construct($asOptions, $bInitialize, $asErrorMessages);
|
||||||
$this->sBody = '';
|
$this->sBody = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->initialize();
|
||||||
|
}
|
||||||
|
|
||||||
protected function body($sText)
|
protected function body($sText)
|
||||||
{
|
{
|
||||||
$this->sBody .= $sText;
|
$this->sBody .= $sText;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<div id="progress">
|
<div id="progress">
|
||||||
<div class="bar" style="width: 0%;"></div>
|
<div class="bar" style="width: 0%;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="status"></div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
oSpot.pageInit = function(asHash)
|
oSpot.pageInit = function(asHash)
|
||||||
@@ -12,8 +13,10 @@ oSpot.pageInit = function(asHash)
|
|||||||
.fileupload({
|
.fileupload({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
done: function (e, data) {
|
done: function (e, data) {
|
||||||
$.each(data.result.files, function (index, file) {
|
var $Status = $('#status');
|
||||||
$('<p/>').text(file.name).appendTo(document.body);
|
$.each(data.result.files, function(iKey, oFile) {
|
||||||
|
|
||||||
|
$Status.append(file.name+" uploaded succesfully");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
progressall: function (e, data) {
|
progressall: function (e, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user