diff --git a/README.md b/README.md index b79a8e7..80b901c 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,24 @@ Error: CocoaPods was not found. Please install version 1.0.1 or greater from htt Occore installare `CocoaPods` come descritto sulla [documentazione del plugin](https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/INSTALLATION.md#ios-details) - +## Download ## + +## Google Play ## + +Solo per chi ha un account google. + +Sconsigliamo l'installazione dal Google Play perche' google come multinazionale profila ogni tuo gusto e l'utilizza a scopo commerciale. In pratica ti tratta come merce per accaparrarsi profitto. Se ti e' possibile quindi utilizza fdroid. + +https://play.google.com/store/apps/details?id=xm24.digitigrafo.it + +## Repository Privato Fdroid ## + +Repository gestito da hacklabbo, non e' il repository fdroid ufficiale. + +Per poter utilizzare questo repository devi comunque scaricare l'applicazione [fdroid](https://f-droid.org/) e aggiungere questo repository ed attivarlo nella configurazione dell'applicazaione. E' un operazione piuttosto semplice da effettuare. + +https://fdroid.hacklabbo.indivia.net/ + ## TODO, ISSUE e FEATURE ## Usiamo l'[issue tracker](https://git.lattuga.net/hacklabbo/Ilovexm24/issues) non il wiki. diff --git a/android-debug.apk b/android-debug.apk deleted file mode 100644 index 432eef5..0000000 Binary files a/android-debug.apk and /dev/null differ diff --git a/config.xml b/config.xml index c62cff5..b750a46 100644 --- a/config.xml +++ b/config.xml @@ -32,7 +32,6 @@ - diff --git a/hooks/after_prepare/030_remove_permissions.js b/hooks/after_prepare/030_remove_permissions.js new file mode 100755 index 0000000..d053b3d --- /dev/null +++ b/hooks/after_prepare/030_remove_permissions.js @@ -0,0 +1,39 @@ +#!/usr/bin/env node + +// +// This hook removes specific permissions from the AndroidManifest.xml +// The AndroidManifest is re-generated during the prepare stage, +// so this must be run on the "after_prepare" hook. +// + + +// Configure the permissions to be forcefully removed. +// NOTE: These permissions will be removed regardless of how many plugins +// require the permission. You can check the permission is only required +// by the plugin you *think* needs it, by looking at the "count" shown in +// your /plugins/android.json file. +// If the count is more than 1, you should search through +// the /plugins//plugin.xml files for tags. + +var permsToRm = [ "RECORD_AUDIO", "MODIFY_AUDIO_SETTINGS", "READ_PHONE_STATE" ]; + +var fs = require('fs'); +var path = require('path'); +var rootdir = process.argv[2]; +var manifestFile = path.join(rootdir, "platforms/android/AndroidManifest.xml"); + +fs.readFile( manifestFile, "utf8", function( err, data ) { + if (err) + return console.log( "Error reading AndroidManifest.xml", err ); + + var result = data; + for(var i = 0; i < permsToRm.length; i++) { + var search = ''; + result = result.replace(search, ''); + } + + fs.writeFile( manifestFile, data, "utf8", function( err ){ + if (err) + return console.log( "Error writing AndroidManifest.xml", err ); + }); +} ); \ No newline at end of file diff --git a/www/js/query.js b/www/js/query.js index ede4327..773e275 100644 --- a/www/js/query.js +++ b/www/js/query.js @@ -1,6 +1,5 @@ function myJsonCategory(Qcategory, div, addTagCategory) { - $.mobile.loading('show'); - FONTE.dbHandler.executeSql("SELECT * FROM xm24_posts WHERE category = ? ORDER BY date COLLATE NOCASE DESC;", [Qcategory], function (resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM xm24_posts WHERE category = ? ORDER BY date COLLATE NOCASE DESC;", [Qcategory], function (resultSet) { var items = []; for (var i = 0; i < resultSet.rows.length; i++) { var val = JSON.parse(resultSet.rows.item(i).post); @@ -83,7 +82,10 @@ var drawListPost = function(div, resultSet, position) { } else if(position == 'prepend'){ ul.prependTo(div); } - $.mobile.loading('hide'); + + setTimeout(function () { + $.mobile.loading('hide'); + }, 1000); }; var appendPostList = function(div, resultSet, categories, fallback) { @@ -144,7 +146,7 @@ var getCategoryWhere = function(categories) { var POST = POST || {}; POST.sql = { - init: "SELECT * FROM xm24_posts JOIN xm24_cats_to_posts USING(id) WHERE ", + init: "SELECT DISTINCT * FROM xm24_posts JOIN xm24_cats_to_posts USING(id) WHERE ", end : "ORDER BY date COLLATE NOCASE DESC LIMIT ?" }; @@ -195,7 +197,7 @@ function myJsonLastPage(div) { var firstTime = storage.getItem('db_lastnews_firsttime'); if (firstTime != 'yes') { if (lastnewsDate) { - FONTE.dbHandler.executeSql("SELECT * FROM xm24_posts WHERE date > ? ORDER BY date COLLATE NOCASE DESC LIMIT 40;", [lastnewsDate], function (resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM xm24_posts WHERE date > ? ORDER BY date COLLATE NOCASE DESC LIMIT 40;", [lastnewsDate], function (resultSet) { var items = []; $(div).empty(); if (resultSet.rows.length > 0) { @@ -232,7 +234,7 @@ function myJsonLastPage(div) { function myJsonCategoryPaginated(Qcategory, div, pageNumber) { $.mobile.loading('show'); - FONTE.dbHandler.executeSql("SELECT * FROM xm24_posts WHERE category = ? ORDER BY date COLLATE NOCASE DESC;", [Qcategory], function (resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM xm24_posts WHERE category = ? ORDER BY date COLLATE NOCASE DESC;", [Qcategory], function (resultSet) { var items = []; $(div).empty(); for (var i = 0; i < resultSet.rows.length; i++) { @@ -313,7 +315,7 @@ function myJsonPost(Qid, div_title, div_content, _class) { table = EVENTS.table.single; } - FONTE.dbHandler.executeSql("SELECT * FROM " + table + " WHERE id = ?;", [Qid], function(resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM " + table + " WHERE id = ?;", [Qid], function(resultSet) { if(!_class){ drawPost(div_title, div_content, resultSet); } else { @@ -325,7 +327,7 @@ function myJsonPost(Qid, div_title, div_content, _class) { function myJsonPage(Qid, div_title, div_content) { $.mobile.loading('show'); var pageId = parseInt(Qid); - FONTE.dbHandler.executeSql("SELECT * FROM xm24_pages WHERE id = ?;", [pageId], function (resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM xm24_pages WHERE id = ?;", [pageId], function (resultSet) { for (var i = 0; i < resultSet.rows.length; i++) { var data = resultSet.rows.item(i); var id = data.id; @@ -342,7 +344,7 @@ function myJsonPage(Qid, div_title, div_content) { function myJsonRandomPost(div_title, div_content) { $.mobile.loading('show'); - FONTE.dbHandler.executeSql("SELECT * FROM xm24_posts ORDER BY RANDOM() LIMIT 1;", [], function (resultSet) { + FONTE.dbHandler.executeSql("SELECT DISTINCT * FROM xm24_posts ORDER BY RANDOM() LIMIT 1;", [], function (resultSet) { for (var i = 0; i < resultSet.rows.length; i++) { var val = JSON.parse(resultSet.rows.item(i).post); var id = val.id; diff --git a/www/js/update.js b/www/js/update.js index c980bd1..481ac85 100644 --- a/www/js/update.js +++ b/www/js/update.js @@ -245,9 +245,9 @@ function getLastSinglePageRecur(url, pagenum, categories) { }); }); - if (data.length == 0) { - renderLastNews(FONTE.contentListClass, categories); - } + // if (data.length === 0) { + // renderLastNews(FONTE.contentListClass, categories); + // } }, error: JSONErrorHandler }); diff --git a/www/js/util.js b/www/js/util.js index ccb6f1a..ad149a3 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -8,7 +8,7 @@ function initStorage() { } /*per network info*/ -function checkConnection(code, msgConnect) { +function checkConnection(code, msgConnect, print) { var msgTitle = "Non sei connesso"; msgConnect = msgConnect || "Occore essere connessi per poter ricevere i nuovi articoli"; @@ -23,7 +23,8 @@ function checkConnection(code, msgConnect) { states[Connection.CELL] = 'Cell generic connection'; states[Connection.NONE] = 'No network connection'; if (states[networkState] == 'Unknown connection' || states[networkState] == 'No network connection') { - toastr.warning(msgConnect, msgTitle); + if(! print) + toastr.warning(msgConnect, msgTitle); console.log(code); return false; } else {