/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to trunk/svg Converter/index.php

  • Committer: Henrik G.
  • Date: 2013-03-26 23:22:55 UTC
  • Revision ID: henrik.gustavsson@his.se-20130326232255-ik6snyatlbkf3zs1
First seed of Lenasys ... Needs to be Organized Further

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
                <script language="javascript" src="SVG_httpAjax.js"></script>
 
4
                <script language="javascript">
 
5
                                function returnedSVG(htmltext)
 
6
                                {
 
7
 
 
8
                                                var conto=document.getElementById('content');
 
9
                                                conto.innerHTML=htmltext;
 
10
 
 
11
                                                str='var acanvas=document.getElementById("previewCanvas");acanvas.width=700;var c=acanvas.getContext("2d");'+htmltext;
 
12
                                                eval(str);
 
13
 
 
14
                                }
 
15
                </script>
 
16
</head>
 
17
<body>
 
18
<table><tr>
 
19
        <td style="border:outset 3px #ffeedd; background-color: #fff8f8;font-family:Calibri,Georgia,Serif;" valign="top">
 
20
<?php
 
21
 
 
22
                function endsWith($haystack,$needle,$case=true) {
 
23
                    if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);}
 
24
                    return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
 
25
                }
 
26
 
 
27
                $dir = opendir('.');
 
28
    while (($file = readdir($dir)) !== false) {
 
29
        if(endsWith($file,".svg")){
 
30
                        echo "<span onmouseover='this.style.backgroundColor=\"#000\";this.style.color=\"#fff\"' onmouseout='this.style.backgroundColor=\"#fff8f8\";this.style.color=\"#000\"' style='cursor:pointer;' onclick='getSVG(\"".$file."\");'>".$file."</span><br>";
 
31
        }
 
32
    }
 
33
 
 
34
?>
 
35
</td>
 
36
<td id='preview' style="border:outset 3px #ffeedd; background-color: #fff8f8;font-family:Calibri,Georgia,Serif;" valign="top">
 
37
        Preview:<br>
 
38
        <canvas width="700" height="700" id="previewCanvas">
 
39
        </canvas>
 
40
</td>
 
41
<td style="border:outset 3px #ffeedd; background-color: #fff8f8;" valign="top">
 
42
                <pre id='content' style='font-family:Calibri,Georgia,Serif;'>
 
43
                </pre>
 
44
</td>
 
45
</tr></table>
 
46
</body>
 
47
</html>
 
 
b'\\ No newline at end of file'