Subversion Repositories wimsdev

Rev

Rev 17770 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17770 Rev 17773
Line 265... Line 265...
265
                        for i in range(9)]
265
                        for i in range(9)]
266
            col_enum = [{"i": i+1,
266
            col_enum = [{"i": i+1,
267
                         "left": left_margin + i * (col_gap + div_width) + \
267
                         "left": left_margin + i * (col_gap + div_width) + \
268
                         (col_extra_gap if i > 1 else 0)} \
268
                         (col_extra_gap if i > 1 else 0)} \
269
                        for i in range(18)]
269
                        for i in range(18)]
-
 
270
            total_width = 18 * div_width + 17 * col_gap + col_extra_gap + \
-
 
271
                2 * left_margin
-
 
272
            total_height = 9 * div_height + 8 * row_gap + row_extra_gap + \
-
 
273
                2 * top_margin
270
            ################################
274
            ################################
271
            dict = { # pour formater le fichier modèle mendeleiev_template.css
275
            dict = { # pour formater le fichier modèle mendeleiev_template.css
272
                "div_width": div_width,
276
                "div_width": div_width,
273
                "div_height": div_height,
277
                "div_height": div_height,
274
                "symbol_top": symbol_top,
278
                "symbol_top": symbol_top,
Line 300... Line 304...
300
                result += "<script>\n" + infile.read() + "</script>\n"
304
                result += "<script>\n" + infile.read() + "</script>\n"
301
        # suite de DIVs, un par élément
305
        # suite de DIVs, un par élément
302
        result += "\n".join([elt.toHtml() for elt in Element.get_table()]) + "\n"
306
        result += "\n".join([elt.toHtml() for elt in Element.get_table()]) + "\n"
303
        # enrobage dans un DIV commun
307
        # enrobage dans un DIV commun
304
        result = """\
308
        result = """\
305
<div id="mendeleiev_table" style="position: relative">{r}</div>
309
<div id="mendeleiev_table" style="position: relative; width: {w}px; height: {h}px;">{r}</div>
306
<div id="one_element"></div>
310
<div id="one_element"></div>
307
<div id="wait" style="width:500; text-align: center;
311
<div id="wait" style="width:500; text-align: center;
308
     background: rgba(200,200,255,0.5); position: absolute;
312
     background: rgba(200,200,255,0.5); position: absolute;
309
     top: 50px; left: 200px; border: 1px navy solid; border-radius: 3px;">
313
     top: 50px; left: 200px; border: 1px navy solid; border-radius: 3px;">
310
        Wait a few seconds...
314
        Wait a few seconds...
311
</div>
315
</div>
312
""".format(r=result)
316
""".format(r=result, w=total_width, h=total_height)
313
        if standalone:
317
        if standalone:
314
            result = """\
318
            result = """\
315
<html>
319
<html>
316
  <head>
320
  <head>
317
     <title>Mendeleiev table</title>
321
     <title>Mendeleiev table</title>