/lenasys/trunk

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

« back to all changes in this revision

Viewing changes to svg Converter/svgconverter.php

  • Committer: galaxyAbstractor
  • Date: 2013-04-24 14:31:47 UTC
  • mto: This revision was merged to the branch mainline in revision 52.
  • Revision ID: galaxyabstractor@gmail.com-20130424143147-1pdkbu65n1896lmu
Started implementing categories and a menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html>
1
2
<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>
 
3
        
 
4
        <head>
 
5
                        <script language="javascript" src="svgconverter.js">
 
6
                        </script>
 
7
                        <link rel="stylesheet" type="text/css" href="svgconverter.css">
 
8
        </head>
 
9
        
 
10
        <body>
 
11
                <table><tr>
 
12
                        <td id='preview'>
 
13
                                <?php
 
14
                                        function endsWith($haystack, $needle, $case=true) {
 
15
                                                if($case){
 
16
                                                        return( strcmp( substr( $haystack, strlen( $haystack ) - strlen( $needle )), $needle ) === 0 );
 
17
                                                }
 
18
                                                return( strcasecmp( substr( $haystack, strlen( $haystack) - strlen( $needle )), $needle ) === 0 );
 
19
                                        }
 
20
                                        $dir = opendir( '../media/svgconverter' );
 
21
                                        while(( $file = readdir( $dir )) !== false ) {
 
22
                                                if( endsWith( $file, ".svg" )) {
 
23
                                                        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>";
 
24
                                                }
 
25
                                        }
 
26
                                ?>
 
27
                        </td>
 
28
                        <td id='preview'>
 
29
                                Preview:<br>
 
30
                                <canvas width="700" height="700" id="previewCanvas">
 
31
                                </canvas>
 
32
                        </td>
 
33
                        <td id='preview'>
 
34
                                <pre id='content'>
 
35
                                </pre>
 
36
                        </td>
 
37
                </tr></table>
 
38
        </body>
 
39
 
47
40
</html>
 
 
b'\\ No newline at end of file'