Browse Source

Bunch of bugfixes

tags/1.1.6
Leonie 3 months ago
parent
commit
20ccf4fe2c
12 changed files with 5492 additions and 31 deletions
  1. 3
    0
      .vscode/settings.json
  2. 1
    3
      app/config.xml
  3. 5409
    1
      app/package-lock.json
  4. 9
    3
      app/package.json
  5. 1
    1
      app/www/app.html
  6. 20
    5
      app/www/app.js
  7. 8
    2
      app/www/config.js
  8. 1
    1
      app/www/index.html
  9. 13
    7
      app/www/player.js
  10. 7
    0
      app/www/shownotes.js
  11. 16
    7
      app/www/style.css
  12. 4
    1
      backend.py

+ 3
- 0
.vscode/settings.json View File

@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python3"
}

+ 1
- 3
app/config.xml View File

@@ -84,9 +84,6 @@
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<preference name="StatusBarOverlaysWebView" value="true" />
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="StatusBarBackgroundColor" value="#ffffff" />
<allow-navigation href="http://*/*" />
<allow-intent href="https://*/*" />
<engine name="android" spec="~7.1.4" />
@@ -97,4 +94,5 @@
<plugin name="cordova-plugin-whitelist" spec="~1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="~2.4.2" />
<plugin name="cordova-plugin-globalization" spec="~1.0.9" />
<plugin name="cordova-plugin-music-controls" spec="git+https://github.com/homerours/cordova-music-controls-plugin.git" />
</widget>

+ 5409
- 1
app/package-lock.json
File diff suppressed because it is too large
View File


+ 9
- 3
app/package.json View File

@@ -13,7 +13,8 @@
"cordova-plugin-network-information": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-globalization": {}
"cordova-plugin-globalization": {},
"cordova-plugin-music-controls": {}
}
},
"dependencies": {
@@ -21,9 +22,14 @@
"cordova-plugin-device": "~1.1.7",
"cordova-plugin-dialogs": "~1.3.4",
"cordova-plugin-file": "~4.3.3",
"cordova-plugin-globalization": "~1.0.9",
"cordova-plugin-music-controls": "git+https://github.com/homerours/cordova-music-controls-plugin.git",
"cordova-plugin-network-information": "~1.3.4",
"cordova-plugin-whitelist": "~1.3.3",
"cordova-plugin-statusbar": "~2.4.2",
"cordova-plugin-globalization": "~1.0.9"
"cordova-plugin-whitelist": "~1.3.3"
},
"devDependencies": {
"@angular/cli": "8.1.0",
"@ionic/v1-toolkit": "2.0.5"
}
}

+ 1
- 1
app/www/app.html View File

@@ -48,7 +48,7 @@
<input type="text" id="qq" placeholder="Search term" />
</div>
</div><br />
<audio id="player" src=""></audio>
<audio id="player" src="" loop></audio>
<p><i id="snclose" class="ion-md-close"></i></p>
<div id="view__main">

+ 20
- 5
app/www/app.js View File

@@ -56,7 +56,7 @@ $(document).ready(function() {
localStorage.setItem("lang", "ca");
}
});
}, 3700);
}, 700);
if (findGetParameter("cast")) {
$("#logo__intro").hide();
$("#view__settings").hide();
@@ -88,7 +88,7 @@ $(document).ready(function() {
$("#text__cast").html(twemoji.parse(callback.feed.title.split(" | ")[0].split(" - ")[0].split(" – ")[0]));
$("#text__subtitle").html(callback.feed.subtitle);
$("#text__author").html(callback.feed.author.split(" | ")[0].split(" - ")[0].split(" – ")[0]);
$("#text__description").html(callback.feed.summary.replaceAll("\n", "<br />"));
$("#text__description").html(callback.feed.summary_detail.value.replaceAll("\n", "<br />"));
callback.entries.forEach(function(item) {
var secret = "";
secret = item.id.replaceAll("/", "-").replace(".", "-").replace(".", "-").replace(".", "-").replace(".", "-").replace(".", "-").replace(".", "-").replace("http:", "").replace("https:", "").replace("--", "").replace("+", "-").replaceAll(":", "-").replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g,"-").replace("?", "");
@@ -98,7 +98,13 @@ $(document).ready(function() {
podurl = el.href;
}
});
$("#podtable tbody").append("<tr><td><i onclick=\"playcast('"+podurl+"', '"+secret+"', '"+item.title.replaceAll("'", "")+"', '"+callback.feed.author.split(" | ")[0].split(" - ")[0].split(" – ")[0]+"', '"+callback.feed.image.href+"', '"+feed+"')\" id=\"cast-"+secret+"\" class=\"playbutton ion-md-play\"></i></td><td>"+twemoji.parse(item.title)+"</td><td><a onclick=\"shownotes('"+Base64.encode(item.summary.replaceAll("\n", "<br>"))+"')\"><i class=\"ion-md-information-circle-outline\" id=\"snbutton\"></i></a></td></tr>");
var shownotes = "";
item.content.forEach(function(el) {
if (el.type === "text/html") {
shownotes = el.value;
}
});
$("#podtable tbody").append("<tr><td><i onclick=\"playcast('"+podurl+"', '"+secret+"', '"+item.title.replaceAll("'", "")+"', '"+callback.feed.author.split(" | ")[0].split(" - ")[0].split(" – ")[0]+"', '"+callback.feed.image.href+"', '"+feed+"')\" id=\"cast-"+secret+"\" class=\"playbutton ion-md-play\"></i></td><td>"+twemoji.parse(item.title)+"</td><td><a onclick=\"shownotes('"+Base64.encode(shownotes)+"')\"><i class=\"ion-md-information-circle-outline\" id=\"snbutton\"></i></a></td></tr>");
});
$("#button__follow").click(function() {
$.get(backend+"/api/v1/getlist/"+localStorage.getItem("username")+"/"+localStorage.getItem("uuid"), function(data) {
@@ -234,11 +240,13 @@ $(document).ready(function() {
if (searchtoggle === false) {
$("#wrapper__search").show();
searchtoggle = true;
$("#view__main").css("padding-top", "165px");
$("#view__main").css("margin-top", "90px");
$("#shownotes").css("margin-top", "90px");
} else {
$("#wrapper__search").hide();
searchtoggle = false;
$("#view__main").css("padding-top", "90px");
$("#view__main").css("margin-top", "0px");
$("#shownotes").css("margin-top", "0px");
}
});
$(".fa__nav").click(function() {
@@ -289,6 +297,13 @@ $(document).ready(function() {
$("#link__cast").click(function() {
window.setTimeout(function() {
loadview();
window.setTimeout(function() {
if (playing) {
$("#cast-"+localStorage.getItem("secret")).attr("class", "playbutton ion-md-pause");
} else {
$("#cast-"+localStorage.getItem("secret")).attr("class", "playbutton ion-md-play");
}
}, 1700);
}, 500);
});


+ 8
- 2
app/www/config.js View File

@@ -1,2 +1,8 @@
var backend = "https://api.nordcast.app";
var debug = false;
var backend = "http://192.168.178.22:9000";
var debug = false;

function onDeviceReady() {
screen.orientation.lock('portrait');
StatusBar.styleLightContent();
StatusBar.backgroundColorByHexString("#fff");
}

+ 1
- 1
app/www/index.html View File

@@ -26,7 +26,7 @@
<p><input type="email" id="username" placeholder="E-mail"></p>
<p><input type="password" id="password" placeholder="Password"></p>
<p><a href="#" onclick="window.open('https://koyu.space/terms', '_system'); return false;"><i class="ion-md-lock"></i> <span id="text__safe">Your data is safe.</span></a></p>
<p><button class="btn btn-primary" id="kslogin" style="width: 80%;">Login</button></p>
<p><button class="btn btn-primary btn-lg" id="kslogin" style="width: 80%;">Login</button></p>
<div id="welcome__error"><p><b style="color:red;">Your username and/or password is wrong.</b></p></div>
</div>
</body>

+ 13
- 7
app/www/player.js View File

@@ -47,7 +47,7 @@ function playcast(file, secret, title, author, podcover, feed) {
window.setInterval(function() {
$.get(backend+"/api/v1/setpos/"+localStorage.getItem("username")+"/"+localStorage.getItem("uuid")+"/"+localStorage.getItem("secret")+"/"+player.currentTime, function(data) { });
}, 1000);
/*MusicControls.create({
MusicControls.create({
track : title,
artist : author,
cover : podcover,
@@ -56,11 +56,17 @@ function playcast(file, secret, title, author, podcover, feed) {
duration : player.duration,
elapsed : player.currentTime,
skipForwardInterval : 10,
skipBackwardInterval : 10
}, onSuccess, onError);*/
skipBackwardInterval : 10,
playIcon: 'media_play',
pauseIcon: 'media_pause',
prevIcon: 'media_prev',
nextIcon: 'media_next',
closeIcon: 'media_close',
notificationIcon: 'notification'
}, onSuccess, onError);
} else {
$(".playbutton").attr("class", "playbutton ion-md-play");
//MusicControls.destroy();
MusicControls.destroy();
}
}

@@ -85,13 +91,13 @@ window.setInterval(function() {
window.setInterval(function() {
var player = document.getElementById("player");
$("#timeleft").html("-"+String(player.duration - player.currentTime).toHHMMSS());
/*if (playing) {
if (playing) {
MusicControls.updateElapsed({
elapsed: player.currentTime,
isPlaying: true
});
}*/
}, 1);
}
}, 100);

function ffw() {
var player = document.getElementById("player");

+ 7
- 0
app/www/shownotes.js View File

@@ -2,6 +2,7 @@ var oldhtml = "";

function shownotes(shownotes) {
oldhtml = $("#view__main").html();
$(".fa__nav2").hide();
$("#view__main").html("<div id=\"shownotes\">"+Base64.decode(shownotes)+"</div>");
$("#view__main").css("padding", "20px");
$("#view__main").css("padding-top", "100px");
@@ -10,5 +11,11 @@ function shownotes(shownotes) {
}

function restoreview() {
$(".fa__nav2").show();
$("#view__main").html(oldhtml);
if (playing) {
$("#cast-"+localStorage.getItem("secret")).attr("class", "playbutton ion-md-pause");
} else {
$("#cast-"+localStorage.getItem("secret")).attr("class", "playbutton ion-md-play");
}
}

+ 16
- 7
app/www/style.css View File

@@ -13,7 +13,11 @@ body {
}

#view__main {
padding-left: 20px;
padding: 90px 20px 0px !important;
}

#shownotes {
padding-top: 40px;
}

#logo__intro {
@@ -143,8 +147,7 @@ h1, h2, h3, h4, h5, h6 {
font-size: 24pt;
font-family: 'open_sanslight';
font-weight: 300;
padding: 12px 20px;
margin: 8px 0;
padding: .5rem 1rem;
}

#wrapper__search input:focus {
@@ -203,10 +206,12 @@ ion-icon {
padding: 10px;
padding-top: 30px;
margin-left: -20px;
width: calc(100% + 20px);
}

#podtable {
margin-left: -20px;
margin-right: -20px;
}

#text__description {
@@ -229,7 +234,7 @@ th, td {
}

#podtable tr:nth-child(even) {
background-color: #f2f2f2
background-color: #f2f2f2;
}

#text__cast {
@@ -254,11 +259,14 @@ h1 .emoji {
#snclose,
.playbutton {
font-size: 24px;
margin-right: 20px;
height: 24px;
width: 24px;
}

#player__controls i {
margin-right: 20px !important;
}

#timer {
margin-right: 60px;
}
@@ -270,8 +278,9 @@ h1 .emoji {

#snclose {
float: right;
margin-top: 65px;
margin-bottom: 10px;
margin-top: 80px;
margin-right: 10px;
margin-bottom: 20px;
}

#shownotes img {

+ 4
- 1
backend.py View File

@@ -1,3 +1,6 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from bottle import get, post, request, response, route, run, redirect
from mastodon import Mastodon
import feedparser
@@ -19,7 +22,7 @@ def getpodcast():
q = request.query["q"] # pylint: disable=unsubscriptable-object
response.headers['Access-Control-Allow-Origin'] = '*'
response.content_type = "application/json"
return json.dumps(feedparser.parse(q))
return json.dumps(feedparser.parse(q), default=lambda o: '<not serializable>')

@get("/api/v1/getbanner/<val>")
def getbanner(val):

Loading…
Cancel
Save