Compare commits

..

No commits in common. "fa9a02e619e1aa84cab8c9ffbc3584915fd922c0" and "24694d07048aedcfb35db6b203b9e285c06a5962" have entirely different histories.

3 changed files with 56 additions and 46 deletions

View file

@ -335,7 +335,7 @@
<script> <script>
//funzione carica pagina //funzione carica pagina
</script> </script>
<button onclick="shareMeNow('ciao', 'testo', 'http://www.enc.org/xm24')">Text Share</button> <button onclick="window.plugins.socialsharing.share('Message only')">message only</button>
</div> </div>
<!-- chiude body--> <!-- chiude body-->
</div> </div>

View file

@ -156,10 +156,7 @@ function overlayblock() {
$(".overlaynero").toggleClass("hide"); $(".overlaynero").toggleClass("hide");
} }
/*per network info*/ /*per network info*/
function checkConnection(code, msgConnect) { function checkConnection() {
var msgTitle = "Non sei connesso";
msgConnect = msgConnect || "Occore essere connessi per poter ricevere i nuovi articoli";
var networkState = navigator.connection.type; var networkState = navigator.connection.type;
var states = {}; var states = {};
states[Connection.UNKNOWN] = 'Unknown connection'; states[Connection.UNKNOWN] = 'Unknown connection';
@ -171,8 +168,7 @@ function checkConnection(code, msgConnect) {
states[Connection.CELL] = 'Cell generic connection'; states[Connection.CELL] = 'Cell generic connection';
states[Connection.NONE] = 'No network connection'; states[Connection.NONE] = 'No network connection';
if (states[networkState] == 'Unknown connection' || states[networkState] == 'No network connection') { if (states[networkState] == 'Unknown connection' || states[networkState] == 'No network connection') {
toastr.warning(msgConnect, msgTitle); //alert('Non sei connesso ad internet, connettiti ad una rete per procedere.');
console.log(code);
return false return false
} else { } else {
return true return true
@ -231,6 +227,8 @@ function postInListTag(div) {
}); });
}; };
function initTag(div) { function initTag(div) {
$.mobile.loading('show'); $.mobile.loading('show');
FONTE.dbHandler.executeSql("SELECT * FROM xm24_tags ORDER BY date COLLATE NOCASE DESC;", [], function (resultSet) { FONTE.dbHandler.executeSql("SELECT * FROM xm24_tags ORDER BY date COLLATE NOCASE DESC;", [], function (resultSet) {
@ -794,42 +792,55 @@ function JSONErrorHandler(jqXHR, textStatus, errorThrown) {
}; };
function cerca() { function cerca() {
var ret = checkConnection('ERR_CERCA'); if (checkConnection()) {
if (ret) {
cercaMe(); cercaMe();
} return true;
} else {
toastr.error('Err: ERR_CERCA');
return ret; return false;
}
}; };
function segnalaBug() { function segnalaBug() {
return checkConnection('ERR_SEGNALA'); if (checkConnection())
return true;
else {
toastr.error('Err: ERR_SEGNALA');
return false;
}
}; };
function mostraEsperto() { function mostraEsperto() {
var ret = checkConnection('ERR_ESPERTO'); if (checkConnection()) {
if (ret) {
myJsonPage(2167, '#espertotitle', '#mostraesperto'); myJsonPage(2167, '#espertotitle', '#mostraesperto');
} return true;
} else {
toastr.error('Err: ERR_ESPERTO');
return ret; return false;
}
}; };
function checkAndUpdate() { function checkAndUpdate() {
var ret = checkConnection('ERR_ESPERTO'); if (checkConnection()) {
if (ret) {
update(); update();
} return true;
} else {
toastr.error('Err: ERR_UPDATE');
return ret; return false;
}
}; };
function checkAndReset() { function checkAndReset() {
var ret = checkConnection('ERR_ESPERTO'); if (checkConnection()) {
if (ret) {
resetAndUpdate(); resetAndUpdate();
} return true;
} else {
toastr.error('Err: ERR_RESET');
return ret; return false;
}
}; };

View file

@ -1,20 +1,19 @@
function shareMeNow(message, subject, url) { // this is the complete list of currently supported params you can pass to the plugin (all optional)
// this is the complete list of currently supported params you can pass to the plugin (all optional) var options = {
var options = { message: 'share this', // not supported on some apps (Facebook, Instagram)
message: message || 'share this', // not supported on some apps (Facebook, Instagram) subject: 'the subject', // fi. for email
subject: subject || 'the subject', // fi. for email files: ['', ''], // an array of filenames either locally or remotely
//files: ['', ''], // an array of filenames either locally or remotely url: 'https://www.website.com/foo/#bar?a=b',
url: url || 'https://www.website.com/foo/#bar?a=b', chooserTitle: 'Pick an app' // Android only, you can override the default share sheet title
}
var onSuccess = function(result) {
console.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
console.log("Shared to app: " + result.app); // On Android result.app is currently empty. On iOS it's empty when sharing is cancelled (result.completed=false)
}
var onError = function(msg) {
console.log("Sharing failed with message: " + msg);
}
window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);
} }
var onSuccess = function(result) {
console.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
console.log("Shared to app: " + result.app); // On Android result.app is currently empty. On iOS it's empty when sharing is cancelled (result.completed=false)
}
var onError = function(msg) {
console.log("Sharing failed with message: " + msg);
}
window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);