Aggiunto funzionalità di share. Fix #9. Fix errore immagine RICARICA non presente. Fix data da visualizzare alla visualizzazione di un post singolo

This commit is contained in:
gine 2017-03-25 18:37:25 +01:00
parent ad8c25afa1
commit aba6b6e0ee
3 changed files with 28 additions and 10 deletions

View file

@ -160,7 +160,7 @@
</div>
</div><!-- chiude pagina -->
<div data-role="page" id="quotidiano" data-transition="slide" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<!--<div data-role="page" id="quotidiano" data-transition="slide" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
<div class="ui-body">
<img onclick="myJsonRandomPost('#titolosingleR', '#mostracontentsingleR');" src="./image/RICARICA.png" style="float:right;width:80px;cursor:pointer;" />
@ -173,7 +173,7 @@
</p>
</div>
</div>
</div><!--chiude content -->
</div>--><!--chiude content -->
<div data-role="page" id="singleQpost" data-prev="index" data-next="" data-dom-cache="true" data-theme="a" class="ui-page">
<div role="main" class="ui-content">
@ -184,7 +184,6 @@
<i>Non è stato attalmente caricato alcun contenuto</i>
</span>
</p>
<button onclick="shareMeNow('ciao', 'testo', 'http://www.enc.org/xm24')">Text Share</button>
</div>
</div>
</div><!-- chiude pagina -->

View file

@ -239,15 +239,25 @@ function drawPost(div_title, div_content, resultSet){
for (var i = 0; i < resultSet.rows.length; i++) {
var val = JSON.parse(resultSet.rows.item(i).post);
var id = val.id;
var time = val.modified;
var time = val.date;
var title = val.title.rendered;
var url = val.guid.rendered;
var content = val.content.rendered;
var tags = val.tags;
content = findImg(content);
$(div_title).html(title);
//key mi dice l'indice'
var shareButton = $('<button>', {
class : "share-btn ui-btn ui-shadow ui-corner-all",
text: "Condividi"
}).click(function(){
shareMeNow(title, '',url);
});
$('.share-btn').remove();
$(div_content).html("<p>" + content + "</p>");
$(div_content).after(shareButton);
}
}
@ -264,8 +274,17 @@ function drawEvent(div_title, div_content, resultSet){
var geo = val.geo;
$(div_title).html(title);
//key mi dice l'indice'
$(div_content).html("<p>" + content + "</p>");
var shareButton = $('<button>', {
class : "share-btn ui-btn ui-shadow ui-corner-all",
text: "Condividi"
}).click(function(){
shareMeNow(title, evInitDate + " "+ evEndDate, url);
});
$('.share-btn').remove();
$(div_content).html("<small>" + evInitDate +"-" + evEndDate +"</small><p>" + content + "</p>");
$(div_content).after(shareButton);
}
}

View file

@ -1,10 +1,10 @@
function shareMeNow(message, subject, url) {
// this is the complete list of currently supported params you can pass to the plugin (all optional)
var options = {
message: message || 'share this', // not supported on some apps (Facebook, Instagram)
subject: subject || 'the subject', // fi. for email
message: message || '', // not supported on some apps (Facebook, Instagram)
subject: subject || 'Share this:', // fi. for email
//files: ['', ''], // an array of filenames either locally or remotely
url: url || 'https://www.website.com/foo/#bar?a=b',
url: url || 'https://www.ecn.org/xm24',
};
var onSuccess = function(result) {