Your Name 3 anos atrás
pai
commit
9e7f6fdbde
1 arquivos alterados com 9 adições e 7 exclusões
  1. 9 7
      designer/designer_gen.py

+ 9 - 7
designer/designer_gen.py

@@ -24,15 +24,17 @@ def extract_comp(fname):
 
 
 #<script async defer crossorigin="anonymous" src="https://connect.facebook.net/
-def proc_file(fname,fname2):
+def proc_file(fname,fname2,compcontent):
     fr=codecs.open(fname,'r','utf-8')
     fw=codecs.open(fname2,'w','utf-8')
     lines=fr.readlines()
     for l in lines:
 #        <div class="row mt-5" id="row">
         if 'div' in l and 'class' in l and 'row mt-5' in l and 'id="row"' in l:
-            fw.write('<div class="row mt-5" id="row_choz8">\n')
+            fw.write('<div class="row mt-5" id="row_intro">\n')
+            fw.write(compcontent)
             fw.write('</div>\n')
+            fw.write('<div class="row mt-5" id="row_company">\n')
 
         if 'nav-link' in l and '設計師專欄' in l and 'class' in l:
             fw.write('<a class="nav-link "  onclick="forum();">設計師專欄</a>')
@@ -42,10 +44,10 @@ def proc_file(fname,fname2):
         if '</script>' in l:
             fw.write("\n")
             fw.write("function forum(){ \n")
-            fw.write("var r8= document.getElementById('row_choz8'); \n")
-            fw.write("var r9 =  document.getElementById('row_choz9'); \n")
-            fw.write(' r8.style.display="none";  \n')
-            fw.write(' r9.style.display = "block";  \n')
+            fw.write("var rintro= document.getElementById('row_intro'); \n")
+            fw.write("var rcomp =  document.getElementById('row_company'); \n")
+            fw.write(' rintro.style.display="none";  \n')
+            fw.write(' rcomp.style.display = "block";  \n')
             fw.write('alert("jared");')
             fw.write("} \n")
 
@@ -70,7 +72,7 @@ for c in cursor:
 
     result=extract_comp(curdir+"/comp.html")
     print(result)
-    proc_file(curdir+"/orig.html",curdir+"/index.html")
+    proc_file(curdir+"/orig.html",curdir+"/index.html",result)
     break