@lexho111/plainblog 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Blog.js +2 -2
- package/model/DatabaseModel.js +2 -1
- package/package.json +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
package/Blog.js
CHANGED
|
@@ -147,7 +147,7 @@ export default class Blog {
|
|
|
147
147
|
const dbTitle = await this.#databaseModel.getBlogTitle();
|
|
148
148
|
const dbArticles = await this.#databaseModel.findAll();
|
|
149
149
|
//console.log(`articles: ${JSON.stringify(dbarticles)}`)
|
|
150
|
-
this.reloadScriptsStylesOnGET =
|
|
150
|
+
this.reloadScriptsStylesOnGET = true;
|
|
151
151
|
if(this.reloadScriptsStylesOnGET) console.log("reload scripts and styles on GET-Request");
|
|
152
152
|
let title = "";
|
|
153
153
|
if (this.title.length > 0) title = this.title; // use blog title if set
|
|
@@ -188,7 +188,7 @@ export default class Blog {
|
|
|
188
188
|
if (this.#databaseModel) await this.#databaseModel.save(newArticleData);
|
|
189
189
|
if (this.#isExternalAPI) await postData(this.#apiUrl, newArticleData);
|
|
190
190
|
// Add the article to the local list for immediate display
|
|
191
|
-
this.articles.unshift(new Article(title, content));
|
|
191
|
+
this.articles.unshift(new Article(title, content, new Date()));
|
|
192
192
|
} catch (error) {
|
|
193
193
|
console.error("Failed to post new article to API:", error);
|
|
194
194
|
}
|
package/model/DatabaseModel.js
CHANGED
|
@@ -100,7 +100,8 @@ export default class DatabaseModel {
|
|
|
100
100
|
limit,
|
|
101
101
|
offset,
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
const articles = await this.#Article.findAll(options);
|
|
104
|
+
return articles.map((article) => article.get({ plain: true }));
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
async save(newArticle) {
|
package/package.json
CHANGED
package/styles.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.grid{border:0 solid #000;display:grid;gap:.25rem;grid-template-columns:1fr}.grid article{border:0 solid #ccc;border-radius:4px;min-width:0;overflow-wrap:break-word;padding:.25rem}nav a:visited{color:#3b40c1;text-decoration-color:#3b40c1}body{background-color:#fdfdfd;font-family:Arial}nav a{color:#3b40c1;font-size:20px;text-decoration:underline}.datetime{color:#434343;font-style:italic}
|
|
1
|
+
.grid{border:0 solid #000;display:grid;gap:.25rem;grid-template-columns:1fr}.grid article{border:0 solid #ccc;border-radius:4px;min-width:0;overflow-wrap:break-word;padding:.25rem}nav a:visited{color:#3b40c1;text-decoration-color:#3b40c1}body{background-color:#fdfdfd;font-family:Arial}nav a{color:#3b40c1;font-size:20px;text-decoration:underline}.datetime{color:#434343;font-style:italic}h2{margin:0 0 5px}p{margin-top:10px}span{margin:0}
|
|
2
2
|
/*# sourceMappingURL=styles.min.css.map */
|
package/styles.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["styles-compiled.css","styles.css"],"names":[],"mappings":"AAAA,MAIA,mBAAA,CAHA,YAAA,CAEA,UAAA,CADA,yBAGA,CACA,cAEA,mBAAA,CACA,iBAAA,CACA,WAAA,CACA,wBAAA,CAJA,cAKA,CAOA,cACA,aAAA,CACA,6BACA,CCtBA,KACA,wBAAA,CACA,iBACA,CAEA,MAEA,aAAA,CACA,cAAA,CAFA,yBAGA,CAEA,UAEA,aAAA,CADA,iBAEA","file":"styles.min.css","sourcesContent":[".grid {\n display: grid;\n grid-template-columns: 1fr;\n gap: 0.25rem;\n border: 0px solid black;\n}\n.grid article {\n padding: 0.25rem;\n border: 0px solid #ccc;\n border-radius: 4px;\n min-width: 0; /* Allow grid items to shrink */\n overflow-wrap: break-word; /* Break long words */\n}\n\nnav a {\n text-decoration: underline;\n color: rgb(59, 64, 193);\n font-size: 20px;\n}\nnav a:visited {\n color: rgb(59, 64, 193);\n text-decoration-color: rgb(59, 64, 193);\n}","body {\n background-color: rgb(253, 253, 253);\n font-family: Arial;\n}\n\nnav a {\n text-decoration: underline;\n color: rgb(59, 64, 193);\n font-size: 20px;\n}\n\n.datetime {\n font-style: italic;\n color: rgb(67, 67, 67);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["styles-compiled.css","styles.css"],"names":[],"mappings":"AAAA,MAIA,mBAAA,CAHA,YAAA,CAEA,UAAA,CADA,yBAGA,CACA,cAEA,mBAAA,CACA,iBAAA,CACA,WAAA,CACA,wBAAA,CAJA,cAKA,CAOA,cACA,aAAA,CACA,6BACA,CCtBA,KACA,wBAAA,CACA,iBACA,CAEA,MAEA,aAAA,CACA,cAAA,CAFA,yBAGA,CAEA,UAEA,aAAA,CADA,iBAEA,CAEA,GAEA,cACA,CAEA,EACA,eACA,CAEA,KACA,QACA","file":"styles.min.css","sourcesContent":[".grid {\n display: grid;\n grid-template-columns: 1fr;\n gap: 0.25rem;\n border: 0px solid black;\n}\n.grid article {\n padding: 0.25rem;\n border: 0px solid #ccc;\n border-radius: 4px;\n min-width: 0; /* Allow grid items to shrink */\n overflow-wrap: break-word; /* Break long words */\n}\n\nnav a {\n text-decoration: underline;\n color: rgb(59, 64, 193);\n font-size: 20px;\n}\nnav a:visited {\n color: rgb(59, 64, 193);\n text-decoration-color: rgb(59, 64, 193);\n}","body {\n background-color: rgb(253, 253, 253);\n font-family: Arial;\n}\n\nnav a {\n text-decoration: underline;\n color: rgb(59, 64, 193);\n font-size: 20px;\n}\n\n.datetime {\n font-style: italic;\n color: rgb(67, 67, 67);\n}\n\nh2 {\n margin: 0;\n margin-bottom: 5px;\n}\n\np {\n margin-top: 10px;\n}\n\nspan {\n margin: 0;\n}\n"]}
|