/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: gustav.hartvigsson at gmail
  • Date: 2013-04-02 12:13:01 UTC
  • mfrom: (4.2.7 hitlerhorabajs)
  • Revision ID: gustav.hartvigsson@gmail.com-20130402121301-ytfzuo7y6cku9s3o
Merge from implemenation group 2:s branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
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>
 
2
        
 
3
        <head>
 
4
                        <script language="javascript" src="SVG_httpAjax.js">
 
5
                        </script>
 
6
        </head>
 
7
        
 
8
        <body>
 
9
                <table><tr>
 
10
                        <td style="border:outset 3px #ffeedd; background-color: #fff8f8;font-family:Calibri,Georgia,Serif;" valign="top">
 
11
                                <?php
 
12
                                        function endsWith($haystack, $needle, $case=true) {
 
13
                                                if($case){
 
14
                                                        return( strcmp( substr( $haystack, strlen( $haystack ) - strlen( $needle )), $needle ) === 0 );
 
15
                                                }
 
16
                                                return( strcasecmp( substr( $haystack, strlen( $haystack) - strlen( $needle )), $needle ) === 0 );
 
17
                                        }
 
18
                                        $dir = opendir( '.' );
 
19
                                        while(( $file = readdir( $dir )) !== false ) {
 
20
                                                if( endsWith( $file, ".svg" )) {
 
21
                                                        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>";
 
22
                                                }
 
23
                                        }
 
24
                                ?>
 
25
                        </td>
 
26
                        <td id='preview' style="border:outset 3px #ffeedd; background-color: #fff8f8;font-family:Calibri,Georgia,Serif;" valign="top">
 
27
                                Preview:<br>
 
28
                                <canvas width="700" height="700" id="previewCanvas">
 
29
                                </canvas>
 
30
                        </td>
 
31
                        <td style="border:outset 3px #ffeedd; background-color: #fff8f8;" valign="top">
 
32
                                <pre id='content' style='font-family:Calibri,Georgia,Serif;'>
 
33
                                </pre>
 
34
                        </td>
 
35
                </tr></table>
 
36
        </body>
 
37
 
47
38
</html>
 
 
b'\\ No newline at end of file'