Browse Source

changes in api

master
Your Name 1 year ago
parent
commit
0a289f9f2f
7 changed files with 38 additions and 3 deletions
  1. 1
    1
      app.py
  2. BIN
      app/data.db
  3. 10
    0
      app/static/css/style.css
  4. 10
    1
      app/static/css/style_pub.css
  5. 7
    0
      app/templates/writer.html
  6. 5
    1
      app/views.py
  7. 5
    0
      nohup.out

+ 1
- 1
app.py View File

@@ -1,4 +1,4 @@
1 1
 from app import app
2 2
 
3 3
 if __name__ == '__main__':
4
-    app.run(host='0.0.0.0',debug=True)
4
+    app.run(host='0.0.0.0',port=1234,debug=True)

BIN
app/data.db View File


+ 10
- 0
app/static/css/style.css View File

@@ -68,6 +68,16 @@ h2{
68 68
   font-style: italic;
69 69
 }
70 70
 
71
+.references{
72
+  display: block;
73
+  font-size: 11px;
74
+  line-height: 18px!important;
75
+  padding: 0;
76
+  margin: 0;
77
+  padding-bottom: 15px;
78
+  max-width: 500px!important;
79
+}
80
+
71 81
 h3{
72 82
     font-weight: normal;
73 83
   	font-family: 'suisseintl';

+ 10
- 1
app/static/css/style_pub.css View File

@@ -1,2 +1,11 @@
1
-#main{font-family: monospace;}
1
+#main{font-family: monospace;
2
+max-width: 50%;}
2 3
 .mono{}
4
+
5
+
6
+.references{
7
+  display: block;
8
+  font-style: italic;
9
+  padding-bottom: 10px;
10
+  max-width: 50%;
11
+}

+ 7
- 0
app/templates/writer.html View File

@@ -38,6 +38,7 @@
38 38
   <a href="#" data-command='insertimage'><i class='fa fa-image'></i></a>
39 39
   <a href="#" data-command='p'>P</a>
40 40
     <a href="#" data-command='imgsub'>img sub</a>
41
+    <a href="#" data-command='references'>references</a>
41 42
   <a href="#" data-command='subscript'><i class='fa fa-subscript'></i></a>
42 43
   <a href="#" data-command='superscript'><i class='fa fa-superscript'></i></a>
43 44
 
@@ -543,6 +544,12 @@ $('#toolbar a').click(function(e) {
543 544
   {
544 545
     selection = window.getSelection().toString();
545 546
 wrappedselection = '<span class="imgsub">' + selection + '</span>';
547
+document.execCommand('insertHTML', false, wrappedselection);
548
+  }
549
+  if(command == "references")
550
+  {
551
+    selection = window.getSelection().toString();
552
+wrappedselection = '<span class="references">' + selection + '</span>';
546 553
 document.execCommand('insertHTML', false, wrappedselection);
547 554
   }
548 555
     if (command == 'createlink' || command == 'insertimage') {

+ 5
- 1
app/views.py View File

@@ -248,7 +248,11 @@ def get_text():
248 248
         removedImg = []
249 249
         imgsub = []
250 250
         for a in soup.find_all("a", {'class':'linkTo'}):
251
-            removedLinks.append(a.extract().get_text())
251
+            removedLinks.append(a.extract()['href'])
252
+        for span in soup.find_all("span", {'class':'references'}):
253
+            span.replace_with("&&ref"+span.get_text()+" &&endref ")
254
+        for span in soup.find_all("u"):
255
+            span.replace_with(" &&uline"+span.get_text()+" &&enduline ")
252 256
         for img in soup.find_all("img"):
253 257
             removedImg.append(img['src'])
254 258
         for subtitle in soup.find_all("span", {'class':'imgsub'}):

+ 5
- 0
nohup.out View File

@@ -0,0 +1,5 @@
1
+1559814619687	addons.xpi	WARN	Can't get modified time of /usr/lib/thunderbird/features/wetransfer@extensions.thunderbird.net
2
+1559832848106	addons.update-checker	WARN	Update manifest for messagingmenu@mozilla.com did not contain an updates property
3
+1559832848125	addons.update-checker	WARN	Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
4
+1559919248530	addons.update-checker	WARN	Update manifest for messagingmenu@mozilla.com did not contain an updates property
5
+1559919248558	addons.update-checker	WARN	Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property

Loading…
Cancel
Save