Compare commits

..

No commits in common. "master" and "release" have entirely different histories.

14 changed files with 87 additions and 319 deletions

7
.gitignore vendored
View file

@ -1,10 +1,3 @@
#Specific Android sec file#
###########################
ilovexm24.keystore
myBuildConfig.json
# Compiled platform #
###################
platforms/

View file

@ -1,48 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10501" android:versionName="1.5.1" package="xm24.digitigrafo.it" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
</provider>
<activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" />
<receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" />
<receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<service android:exported="false" android:name="com.adobe.phonegap.push.GCMIntentService">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.PushInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service android:exported="false" android:name="com.adobe.phonegap.push.RegistrationIntentService" />
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<uses-permission android:name="${applicationId}.permission.PushHandlerActivity" />
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<permission android:name="${applicationId}.permission.PushHandlerActivity" android:protectionLevel="signature" />
</manifest>

View file

@ -88,46 +88,6 @@ Per installare il plugin sulla rete che non viene installato in automatico
Per lanciare l'emulatore Android con l'applicazione.
Ovviamente si deve aver configurato il proprio environment correttamente.
## Aggiornamento
Siam passati allal versione di Cordova 9 e la versione della piattaforma Android 8, per verificare, nella cartella del progetto IloveXM24:
$ cordova -v
9.0.0 (cordova-lib@9.0.1)
$ cordova platform list
Installed platforms:
android 8.0.0
I plugin così:
$ cordova plugin list
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
es6-promise-plugin 4.2.2 "Promise"
phonegap-plugin-push 1.9.4 "PushPlugin"
E le API dell'sdk Android, ora hanno target 28!
Per aggiornarle, da linea di comando, nella cartella dove avete l'ambiente android, io ce l'ho in home/.android/
$ ./android update sdk
Accettate le malvagie licenze e scaricate.
Poi il build pare funzionare :) yhuuu!
Non ricordo se era bloccante o no, ma ci siamo fatte una copia dell AndroidManifest.xml dopo aver aggiunto la platform, così:
cd platforms/android/app/
cp src/main/AndroidManifest.xml AndroidManifest.xml
## build app
cordova build android --release --buildConfig=myBuildConfig.json
### iOS ###
Installando `phonegap-plugin-push` se si incontra questo errore:
@ -150,7 +110,6 @@ Sconsigliamo l'installazione dal Google Play perche' google come multinazionale
https://play.google.com/store/apps/details?id=xm24.digitigrafo.it
## Repository Privato Fdroid ##
Repository gestito da hacklabbo, non e' il repository fdroid ufficiale.
@ -159,8 +118,6 @@ Per poter utilizzare questo repository devi comunque scaricare l'applicazione [f
https://fdroid.hacklabbo.indivia.net/
P.S. Per chi sviluppa: ad ogni commit sarebbe opportuno aumentare l'ultima cifra della versione in config.xml (riga 2: version=1.0.2 -> version=1.0.3) in modo che fdroid riconosca e proponga l'aggiornamento.
## TODO, ISSUE e FEATURE ##
Usiamo l'[issue tracker](https://git.lattuga.net/hacklabbo/Ilovexm24/issues) non il wiki.

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="xm24.digitigrafo.it" version="1.5.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="xm24.digitigrafo.it" version="1.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>I love XM24</name>
<description>
Spazio Sociale Autogestito XM24, Bolognina (BO): info, eventi, comunicati.. I love XM24, iloveXM24
@ -8,10 +8,12 @@
hacklabbo.indivia.net
</author>
<content src="index.html" />
<preference name="SplashScreen" value="res/splashscreen.png" />
<preference name = "SplashScreen" value = "res/splashscreen.png" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
@ -20,36 +22,27 @@
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
<icon src="res/icon.png" />
<allow-intent href = "market:*" />
<icon src = "res/icon.png" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="SplashScreen" value="res/splashscreen.png" />
<splash src="res/splashscreen.png" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreen" value="splashscreen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name = "SplashScreen" value = "res/splashscreen.png" />
<splash src = "res/splashscreen.png" />
<preference name = "AutoHideSplashScreen" value="false" />
<preference name = "SplashScreen" value = "splashscreen" />
<preference name = "SplashScreenDelay" value="3000" />
<preference name = "SplashMaintainAspectRatio" value="true" />
<preference name = "SplashShowOnlyFirstTime" value="false" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-file" spec="~4.3.3" />
<plugin name="cordova-plugin-media" spec="~3.0.1" />
<plugin name="cordova-plugin-network-information" spec="~1.3.3">
<variable name="SENDER_ID" value="667898382143" />
</plugin>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.3">
<variable name="SENDER_ID" value="667898382143" />
</plugin>
<plugin name="cordova-plugin-whitelist" spec="~1.3.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="~5.1.8">
<variable name="SENDER_ID" value="667898382143" />
</plugin>
<plugin name="cordova-sqlite-storage" spec="~2.0.4" />
<plugin name="phonegap-plugin-push" spec="~1.9.4">
<variable name="SENDER_ID" value="667898382143" />
</plugin>
<engine name="android" spec="^8.0.0" />
<plugin name="cordova-sqlite-storage" spec="~2.0.2" />
<plugin name="cordova-plugin-media" spec="~3.0.0" />
<plugin name="cordova-plugin-splashscreen" />
</widget>

View file

@ -20,15 +20,11 @@ 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, "plugin/cordova-plugin-media/config.xml");
/*
"platforms/android/app/AndroidManifest.xml"
*/
var manifestFile = path.join(rootdir, "platforms/android/AndroidManifest.xml");
fs.readFile( manifestFile, "utf8", function( err, data ) {
if (err)
return console.log( "Error reading plugin/cordova-plugin-media/config.xml", err );
return console.log( "Error reading AndroidManifest.xml", err );
var result = data;
for(var i = 0; i < permsToRm.length; i++) {

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -56,7 +56,7 @@
<body>
<!--panel -->
<div data-role="panel" data-position="left" id="outside" data-theme="a" data-position-fixed="true" data-display="overlay" data-swipe-close="true">
<p><img src="image/xm-logo.png" class="panel_logo" /></p>
<p><img src="image/ilovexm24_menu.png" class="panel_logo" /></p>
<ul data-role="listview">
<li><a class="nav" href="#info">Home</a></li>
<li><a class="nav" href="#ilove">I love XM24</a></li>

View file

@ -54,12 +54,11 @@ EVENTS.getDataAndLoad = function (type) {
var evDesc = ai1ec.event.getDescription(event);
var evUrl = ai1ec.event.getUrl(event);
var evGeo = ai1ec.event.getGeo(event);
var evImg = ai1ec.event.getImage(event);
var evInitDate = EVENTS.formatDate(ai1ec.event.getInitDate(event), EVENTS.storeDateFormat);
var evEndDate = EVENTS.formatDate(ai1ec.event.getEndDate(event), EVENTS.storeDateFormat);
FONTE.dbHandler.executeSql('INSERT INTO ' + table + ' VALUES (?,?,?,?,?,?,?,?)', [evId, evTitle, evDesc, evInitDate, evEndDate, evUrl, evGeo, evImg],
FONTE.dbHandler.executeSql('INSERT INTO ' + table + ' VALUES (?,?,?,?,?,?,?)', [evId, evTitle, evDesc, evInitDate, evEndDate, evUrl, evGeo],
//onSuccess
function (resultSet) {
n_evs_ins++;

View file

@ -1,6 +1,6 @@
var ai1ec = (function(){
var API = {}, json = [], events = [];
//Categorie di eventi
API.cats = {
single: 34,
@ -12,60 +12,56 @@ var ai1ec = (function(){
endChar = uid.indexOf('@');
return uid.substr(initChar+1, uid.length - uid.substr(endChar -1).length - initChar );
};
};
//Parser di un evento dell'array tornato da getXmlData
API.event = {
getId : function(event) {
return event.properties.uid ? getCleanId(event.properties.uid.text) : null;
return event.uid ? getCleanId(event.uid) : null;
},
getTitle : function(event) {
return event.properties.summary.text || null;
return event.summary || null;
},
getDescription : function(event) {
return event.properties.description.text || "";
return event.description || "";
},
getInitDate : function(event) {
return event.properties.dtstart && event.properties.dtstart["date-time"] ? event.properties.dtstart["date-time"] : "";
return event.dtstart && event.dtstart._ ? event.dtstart._ : "";
},
getEndDate : function(event) {
return event.properties.dtend && event.properties.dtend["date-time"] ? event.properties.dtend["date-time"] : "";
return event.dtend && event.dtend._ ? event.dtend._ : "";
},
getCats : function(event) {
return event.properties.categories.text || "";
return event.categories || "";
},
getTags : function(event) {
return event.properties["x-tags"] && event.properties["x-tags"]._ ? event.properties["x-tags"]._ : "";
return event["x-tags"] && event["x-tags"]._ ? event["x-tags"]._ : "";
},
getUrl : function(event) {
return event.properties.url && event.properties.url.uri && event.properties.url.uri ? event.properties.url.uri : "";
return event.url && event.url.$ && event.url.$.uri ? event.url.$.uri : "";
},
getContact : function(event) {
return event.properties.contact || "";
return event.contact || "";
},
getGeo : function(event) {
return event.properties.location.text || "";
return event.geo || "";
},
//Regole per gli eventi ripetitivi
//Regole per gli evebti ripetitivi
getRule : function(event) {
return event.properties.rrule || "";
return event.rrule || "";
},
getImage : function(event){
return event.properties['x-wp-images-url'] && event.properties['x-wp-images-url'].unknown ? event.properties['x-wp-images-url'].unknown : "";
},
};
var getXmlData = function(url, catId, callback) {
$.ajax({
url: url,
@ -73,7 +69,7 @@ var ai1ec = (function(){
method: 'GET',
success: function(res) {
json[catId] = $.xml2json(res);
events[catId] = json[catId]["#document"].icalendar.vcalendar.components.vevent;
events[catId] = json[catId]["#document"].vcalendar.vevent;
console.log(events[catId]);
return callback(events[catId]);
},
@ -83,13 +79,13 @@ var ai1ec = (function(){
}
});
};
var getDefaultUrl = function(catId){
catId = catId || API.cats.single;
return API.remote.site + API.remote.q + "&" + API.remote.catq + catId + "&" + API.remote.xmlq;
};
}
//Oggetto che gestisce attività remote
API.remote = {
site : 'http://www.ecn.org/xm24',
@ -99,20 +95,20 @@ var ai1ec = (function(){
xmlq : 'xml=true',
win : 'window=true',
//post_ids
//Torna un array con tutti gli eventi organizzati da xm24, un array vuoto se errore.
getAllEvents : function(catId, callback) {
var url = getDefaultUrl(catId);
getXmlData(url, catId, callback);
},
},
//Torna un array con gli eventi tra -30 e +30 giorni da oggi, un array vuoto se errore.
getLastEvents : function(catId, callback) {
var url = getDefaultUrl(catId) + '&' + API.remote.win;
getXmlData(url, catId, callback);
},
},
}
return API;
})();

View file

@ -25,8 +25,8 @@ PROJECT.labs = [
"di emancipazione, autodefinizione e socializzazione.",
when : [
{day: "Lun", hour: ["19:00", "21:00"], title:"Scuola Italiano con Migranti"},
{day: "Lun", hour: ["21:00", "23:00"], title:"Assemlea di gestione SIM"},
{day: "Mar", hour: ["19:00", "21:00"], title:"Scuola Italiano con Migranti"}
{day: "Mar", hour: ["19:00", "21:00"], title:"Scuola Italiano con Migranti"},
{day: "Mer", hour: ["19:00", "21:00"], title:"Scuola Italiano con Migranti"}
],
old_event: "", //un vecchio evento
site: "http://simxm24.noblogs.org", //sito personale
@ -46,7 +46,7 @@ PROJECT.labs = [
"conoscenza autoproducendo dal basso strumenti alternativi ed infrastrutture "+
"autonome di comunicazione per una partecipazione politica consapevole.",
when : [
{day: "Mer", hour: ["21:00", "24:00"], title:"Hacklabbo" },
{day: "Mer", hour: ["20:00", "23:00"], title:"Hacklabbo" },
],
old_event: "", //un vecchio evento
site: "http://liste.indivia.net/listinfo/hacklabbo", //sito personale
@ -60,7 +60,7 @@ PROJECT.labs = [
"sociale, di incontro, confronto e condivisione, un veicolo sperimentale e "+
"creativo per la trasmissione della cultura e della politica.",
when : [
{day: "Giov", hour: ["20:00", "23:00"], title:"Apertura spazio Infoshock" },
{day: "Giov", hour: ["18:00", "23:00"], title:"Apertura spazio Infoshock" },
],
old_event: "", //un vecchio evento
site: "https://infoshockxm24.noblogs.org", //sito personale
@ -74,9 +74,7 @@ PROJECT.labs = [
"applicare la creazione legata al mondo del visuale. La serigrafia come "+
"tecnica di stampa manuale legata al mondo d.i.y. si pone in maniera "+
"opposta alle logiche della produzione industriale massiva e omologante.",
when : [
{day: "Mer", hour: ["19:30", "22:00"], title:"Apertura serigrafia"},
],
when : [],
old_event: "", //un vecchio evento
site: "", //sito personale
contatto : "serixm@autistici.org", //email
@ -90,15 +88,14 @@ PROJECT.labs = [
"tecnica di stampa manuale legata al mondo d.i.y. si pone in maniera "+
"opposta alle logiche della produzione industriale massiva e omologante.",
when : [
{day: "Mar", hour: ["18:30", "20:00"], title:"Hata Yoga"},
{day: "Mar", hour: ["18:30", "20:30"], title:"Hata Yoga"},
{day: "Mer", hour: ["20:30", "22:30"], title:"Hata Yoga meditativa"},
{day: "Lun", hour: ["20:30", "22:30"], title:"Hata Yoga meditativa"},
{day: "Gio", hour: ["18:30", "20:00"], title:"Hata Yoga"},
{day: "Gio", hour: ["18:30", "21:00"], title:"Hata Yoga"},
{day: "Lun", hour: ["19:00", "21:00"], title:"Tessuti aerei"},
{day: "Mer", hour: ["19:00", "21:00"], title:"Tessuti aerei"},
{day: "Ven", hour: ["19:00", "21:00"], title:"Tessuti aerei"},
{day: "Sab", hour: ["15:00", "17:00"], title:"Shiatsu"},
//{day: "Lun", hour: ["15:00", "17:00"], title:"Acrobalance"}
{day: "Lun", hour: ["15:00", "17:00"], title:"Acrobalance"}
],
old_event: "", //un vecchio evento
site: "http://liste.indivia.net/listinfo/pallestra", //sito personale
@ -113,9 +110,9 @@ PROJECT.labs = [
"di insegnare a praticare una disciplina che ha come principi luguaglianza "+
"e il rispetto reciproco",
when : [
{day: "Lun", hour: ["19:00", "21:00"], title:"Pugilato"},
{day: "Mer", hour: ["19:00", "21:00"], title:"Pugilato Principianti"},
{day: "Ven", hour: ["19:00", "21:00"], title:"Pugilato"},
{day: "Lun", hour: ["20:00", "22:00"], title:"Pugilato"},
{day: "Mer", hour: ["20:00", "22:00"], title:"Pugilato Principianti"},
{day: "Ven", hour: ["20:00", "22:00"], title:"Pugilato"},
],
old_event: "", //un vecchio evento
site: "http://liste.indivia.net/listinfo/pallestra", //sito personale
@ -393,4 +390,4 @@ PROJECT.render = function() {
$('#project p').html("<ul>" + lab + "</ul>");
init = false;
};
};

View file

@ -300,15 +300,11 @@ function drawEvent(div_title, div_content, resultSet){
var id = val.id;
var title = val.title;
var url = val.url;
var content = entityToHtml(val.description);
var content = val.description;
var geo = val.geo;
var imgUrlThumb = getImageUrl(val.img, 'thumb');
$(div_title).html(title);
var img = imgUrlThumb != "" ? "<a href='" + getImageUrl(val.img, 'large') + "'>" +
"<img src='" + imgUrlThumb + "'/>" +
"</a><br>" : "";
$(div_content).html(img + "<small>" + evInitDate +"-" + evEndDate +"</small><p>" + content + "</p>");
$(div_content).html("<small>" + evInitDate +"-" + evEndDate +"</small><p>" + content + "</p>");
renderShareButton(div_content, title, url, evInitDate + " "+ evEndDate);
}
}
@ -379,8 +375,7 @@ function createDB() {
//FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_tags (id INTEGER PRIMARY KEY, title, tag)');
//FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_tags_to_posts (id, tagid)');
//FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_pages (id INTEGER PRIMARY KEY, title, date, page)');
FONTE.dbHandler.executeSql('DROP TABLE IF EXISTS xm24_events_single');
FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_events_single (id INTEGER PRIMARY KEY, title, description, initDate, endDate, url, geo, img)');
FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_events_single (id INTEGER PRIMARY KEY, title, description, initDate, endDate, url, geo)');
//FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_tags_to_events (id, tagid)');
//FONTE.dbHandler.executeSql('CREATE TABLE IF NOT EXISTS xm24_events_repeat (id INTEGER PRIMARY KEY, title, description, initDate, endDate, url, geo)');
}, function () {

View file

@ -59,15 +59,6 @@ function entityToHtml(string) {
return string;
}
function getImageUrl(str, dim) {
var sstr = str.split(";");
for(var i = 0; i < sstr.length; i++) {
if(sstr[i].indexOf(dim) > -1){
return sstr[i +1];
}
}
}
var entity_table = {
// 34: "&quot;", // Quotation mark. Not required
38: "&amp;", // Ampersand. Applied before everything else in the application

View file

@ -63,9 +63,6 @@
for (i = 0; i < xml.childNodes.length; i++) {
node = xml.childNodes[i];
if (node.nodeName === "#comment")
continue;
if (node.nodeType === 1) {
if (node.attributes.length === 0 && node.childElementCount === 0){
@ -119,7 +116,7 @@
}
var root = {};
if (xml.attributes && xml.attributes.length === 0 && xml.childElementCount === 0){
root[xml.nodeName] = normalize(xml.textContent, options);
} else {
@ -136,4 +133,4 @@
} else if (typeof window !== 'undefined') {
window.xml2json = xml2json;
}
})();
})();