/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 svg Converter/svgconverter.php

  • Committer: Gustav Hartvigsson
  • Date: 2013-04-03 15:20:28 UTC
  • mfrom: (9.2.3 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130403152028-2pxwtfhr0c8rduy4
Merging the changes made by implementation group 2 from 20130403 into trunk.

Show diffs side-by-side

added added

removed removed

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