Plugin Directory

Changeset 545310


Ignore:
Timestamp:
05/17/2012 10:27:58 AM (14 years ago)
Author:
DaganLev
Message:

version 1.0.2 with ace editor

Location:
solid-code-theme-editor
Files:
67 added
2 edited

Legend:

Unmodified
Added
Removed
  • solid-code-theme-editor/trunk/readme.txt

    r501834 r545310  
    2222* View any theme files in a tree view structure (including sub directories)
    2323* View all files (not just PHP and CSS)
    24 * Edit the following file extensions: PHP, CSS, JS, XML, HTML, HTM, TXT
     24* Edit the following file extensions: PHP, CSS, JS, XML, HTML, HTM, TXT, SQL
     25* Syntax highlighter and line numbers
    2526* Download a ZIP backup of the whole theme
    2627* Download individual files
     
    4647* Updated single downloader to work on linux system
    4748
     49= 1.0.2 =
     50* added support for synthax highlighter for editor using Ace Editor (for Chrome and Firefox)
     51
    4852== Upgrade Notice ==
    4953
    50 Updated single file downloader to work on linux system
     54added support for synthax highlighter for editor using Ace Editor (for Chrome and Firefox)
  • solid-code-theme-editor/trunk/sc-theme-editor.php

    r501834 r545310  
    44Plugin URI: http://solid-code.co.uk/2011/08/solid-code-theme-editor/
    55Description: Adds a special editor to the theme editor with more functionality
    6 Version: 1.0.1
     6Version: 1.0.2
    77Author: Dagan Lev
    88Author URI: http://solid-code.co.uk
     
    9696                exit();
    9797            }
    98         }
    99        
     98        }       
    10099    }
    101100    ?>
     
    135134        <?php
    136135        $content = '';
    137         $allowedFileExt = array('php','css','js','xml','html','htm','txt');
     136        $allowedFileExt = array('php','css','js','xml','html','htm','txt','sql');
    138137        $urlFile = $file;
    139138        $file = $themes[$theme]['Template Dir'] . '/' . $file;
     
    156155            <form name="textarea_form" id="textarea_form" method="post" action="themes.php?page=scte-theme-editor&amp;theme=<?php echo urlencode($theme); ?>&amp;file=<?php echo urlencode($urlFile); ?>">
    157156                <?php if(in_array($fxt[count($fxt)-1],$allowedFileExt)){ ?>
    158                     <textarea wrap="off" cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content; ?></textarea>
     157                    <textarea style="display:none;" wrap="off" cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content; ?></textarea>
     158                    <div id="editor" style="z-index:1000;position: relative;width: 758px;height: 600px;"><?php echo $content; ?></div>
     159                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/ace.js" type="text/javascript" charset="utf-8"></script>
     160                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
     161                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-css.js" type="text/javascript" charset="utf-8"></script>
     162                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-html.js" type="text/javascript" charset="utf-8"></script>
     163                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-php.js" type="text/javascript" charset="utf-8"></script>
     164                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-sql.js" type="text/javascript" charset="utf-8"></script>
     165                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-text.js" type="text/javascript" charset="utf-8"></script>
     166                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/mode-xml.js" type="text/javascript" charset="utf-8"></script>
     167                    <script src="<?php echo WP_PLUGIN_URL; ?>/solid-code-theme-editor/ace/theme-chrome.js" type="text/javascript" charset="utf-8"></script>
     168                    <script type="text/javascript">
     169                        <!--
     170                        jQuery(document).ready(function(){
     171                            if(jQuery.browser.msie){
     172                                jQuery('#newcontent').show();
     173                                jQuery('#editor').hide();
     174                            }else{
     175                                var editor = ace.edit("editor");
     176                               
     177                                editor.getSession().on('change', function(){
     178                                    jQuery('#newcontent').val(editor.getSession().getValue());
     179                                });
     180                               
     181                                var mode = require("ace/mode/<?php
     182                                    //identify mode
     183                                    $fileExt2 = explode(".",$file);
     184                                    $fileExt = end($fileExt2);
     185                                    switch($fileExt){
     186                                        case 'js':
     187                                            echo 'javascript';
     188                                            break;
     189                                        case 'css':
     190                                            echo 'css';
     191                                            break;
     192                                        case 'html':
     193                                            echo 'html';
     194                                            break;
     195                                        case 'htm':
     196                                            echo 'html';
     197                                            break;
     198                                        case 'php':
     199                                            echo 'php';
     200                                            break;
     201                                        case 'sql':
     202                                            echo 'sql';
     203                                            break;
     204                                        case 'xml':
     205                                            echo 'xml';
     206                                            break;
     207                                        default:
     208                                            echo 'text';
     209                                            break;
     210                                    }
     211                                ?>").Mode;
     212                                editor.getSession().setMode(new mode());
     213                                editor.setTheme("ace/theme/chrome");
     214                            }
     215                        });
     216                        //-->
     217                    </script>
    159218                    <p>
    160219                    <input type="submit" name="submit" id="submit" class="button-primary" value="Update File" tabindex="2" />
Note: See TracChangeset for help on using the changeset viewer.