Skip to content

Commit

Permalink
Merge branch 'dev' into ngupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
privapps committed Apr 27, 2024
2 parents 281e466 + a8f152d commit de6cfd1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ See build details at https://github.com/privapps/notebook-docker-nginx-fpm-alpin
## Feedbacks and suggestions
We would love to hear your opinions. Please let us know from [Feedback From](https://public.biaomail.us.to/stdv.php?id=MTQ=)

## Configuration
The configuration is at `assets/config.json`

## Server side / Editable
You can use privatebin as backend. In addition, there is a custom build backend, that you can edit existing notebook, which make it like a wiki / blog. See details at

https://github.com/privapps/notebook-docker-nginx-fpm-alpine-privatebin/

## Developer guide

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.1.1.
Expand All @@ -94,7 +96,8 @@ To accomplish copy the URL and share to other people, some charecter are replace

## Wish list
- [ ] Multi-languages menu and help doc
- [ ] Implement editiable backend, so existing notebook can be modified
- [x] Implement editiable backend, so existing notebook can be modified
- [ ] Change ngx-md to ngx-markdown

## Please donate:
```
Expand Down
8 changes: 4 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import { NotesComponent } from './notes/notes.component';
import { FormsModule } from '@angular/forms';
import { SettingsComponent } from './settings/settings.component';
import { NgbModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxBootstrapIconsModule, clockFill } from 'ngx-bootstrap-icons';
import { NgxBootstrapIconsModule} from 'ngx-bootstrap-icons';
import {
questionCircle, tree, keyFill, arrowClockwise, book, fileEarmark, fileEarmarkArrowUpFill,
questionCircle, tree, keyFill, arrowClockwise, book, fileEarmark, fileEarmarkArrowUpFill, clockFill,
cloud, cloudFill, exclamationCircleFill, pencilFill, trashFill, caretUpFill, caretDownFill, fileEarmarkPlusFill
} from 'ngx-bootstrap-icons';
import { FulllistComponent } from './fulllist/fulllist.component';

const icons = {
questionCircle, tree, keyFill, arrowClockwise, book, fileEarmark, fileEarmarkArrowUpFill,
cloud, cloudFill, exclamationCircleFill, pencilFill, trashFill, caretUpFill, caretDownFill, fileEarmarkPlusFill, clockFill
questionCircle, tree, keyFill, arrowClockwise, book, fileEarmark, fileEarmarkArrowUpFill, clockFill,
cloud, cloudFill, exclamationCircleFill, pencilFill, trashFill, caretUpFill, caretDownFill, fileEarmarkPlusFill
};

@NgModule({
Expand Down
2 changes: 1 addition & 1 deletion src/app/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
</div>
</div>
<div class="d-grid gap-2">
<button (click)="publish_privatebin_remotely()" class="btn btn-primary" [disabled]="!can_publish()">Publish as New</button>
<button (click)="publish_privatebin_remotely($event)" class="btn btn-primary" [disabled]="!can_publish()">Publish as New</button>
</div>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ export class SettingsComponent implements OnInit {
this.is_loaded = true
}

publish_privatebin_remotely() {
publish_privatebin_remotely(event : any) {
if (this.config.privatebin == null) {
throw new Error('Privatebin not configured')
}
let last_symmetric = this.service.parameters.symmetric
this.service.parameters.symmetric = undefined // force a new key
event.target.disabled = true;
this.service.publish_privatebin(this.config.privatebin.url, this.e2e_key, (resp) => {
event.target.disabled = false
if (resp['status'] && resp['status'] == 1) {
this.handle_fail_fetch(resp)
return
Expand All @@ -212,6 +214,7 @@ export class SettingsComponent implements OnInit {
}
this.next()
}, error => {
event.target.disabled = false
this.service.parameters.symmetric = last_symmetric
this.handle_fail_fetch(error)
}, false, this.ttl);
Expand Down
22 changes: 13 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Notebook :: Privapps</title>
<base href="/index.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="./assets/css/prism.min.css" rel="stylesheet" />
<link href="./assets/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<meta charset="utf-8">
<title>Notebook :: Privapps</title>
<base href="/index.html">
<base target="_blank">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="./assets/css/prism.min.css" rel="stylesheet" />
<link href="./assets/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
</head>

<body>
<app-root></app-root>
<app-root></app-root>
</body>
</html>

</html>

0 comments on commit de6cfd1

Please sign in to comment.