Plugin Directory

Changeset 858784


Ignore:
Timestamp:
02/16/2014 09:35:03 AM (12 years ago)
Author:
rewish
Message:

WP Emmet 0.2.4 Released

Location:
wp-emmet/trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • wp-emmet/trunk/WP/Emmet.php

    r739200 r858784  
    8383        WP_Emmet_Migration::migrate($this);
    8484
    85         $this->registerHooks();
     85        add_action('current_screen', array($this, 'registerHooks'));
    8686    }
    8787
     
    9090     */
    9191    public function registerHooks() {
     92        if (!$this->isInScope()) {
     93            return;
     94        }
     95
    9296        add_action('admin_print_styles', array($this, 'printStyles'));
    9397        add_action('admin_enqueue_scripts', array($this, 'enqueueScripts'));
    9498        add_action('admin_print_footer_scripts', array($this, 'applyScripts'), 1);
     99    }
     100
     101    /**
     102     * Page is in scope?
     103     *
     104     * @return boolean
     105     */
     106    public function isInScope() {
     107        $screen = get_current_screen();
     108        return $screen->base === 'settings_page_' . WP_EMMET_DOMAIN
     109            || $this->Options->get("scope.{$screen->base}") === '1';
    95110    }
    96111
     
    132147     * @return string
    133148     */
    134     protected function editorType() {
     149    public function editorType() {
    135150        return $this->isCodeMirrorMode() ? 'codemirror' : 'textarea';
    136151    }
     
    141156     * @return bool
    142157     */
    143     protected function isCodeMirrorMode() {
     158    public function isCodeMirrorMode() {
    144159        return $this->Options->get('use_codemirror') === '1';
    145160    }
  • wp-emmet/trunk/WP/Emmet/CodeMirror.php

    r738398 r858784  
    2929    }
    3030
     31    /**
     32     * Initialization
     33     */
    3134    public function init() {
    3235        $this->registerStyle('codemirror');
    33         $this->registerThemes();
     36        $this->_registerThemes();
    3437        $this->registerScript('codemirror');
    35         $this->registerModes();
     38        $this->_registerModes();
    3639    }
    3740
     
    4447    public function registerStyle($fileName, $theme = null) {
    4548        $domain = $theme ? "{$this->domain}-{$theme}" : $this->domain;
    46         WP_Emmet::registerStyle($domain, $this->styleFileURL($fileName));
     49        WP_Emmet::registerStyle($domain, $this->_styleFileURL($fileName));
    4750    }
    4851
     
    5558    public function registerScript($fileName, $mode = null) {
    5659        $domain = $mode ? "{$this->domain}-{$mode}" : $this->domain;
    57         WP_Emmet::registerScript($domain, $this->scriptFileURL($fileName));
     60        WP_Emmet::registerScript($domain, $this->_scriptFileURL($fileName));
    5861    }
    5962
     
    9093     * @return string
    9194     */
    92     protected function styleFileURL($name) {
     95    protected function _styleFileURL($name) {
    9396        return WP_Emmet::assetURL("css/codemirror/{$name}.css");
    9497    }
     
    100103     * @return string
    101104     */
    102     protected function scriptFileURL($name) {
     105    protected function _scriptFileURL($name) {
    103106        return WP_Emmet::assetURL("js/codemirror/{$name}.js");
    104107    }
     
    107110     * Register themes
    108111     */
    109     protected function registerThemes() {
     112    protected function _registerThemes() {
    110113        $this->themes = array('default' => 'default');
    111114        $themes = glob(WP_Emmet::assetPath('css/codemirror/theme/*.css'));
     
    121124     * Register modes
    122125     */
    123     protected function registerModes() {
     126    protected function _registerModes() {
    124127        $modes = glob(WP_Emmet::assetPath('js/codemirror/mode/*.js'));
    125128
  • wp-emmet/trunk/WP/Emmet/FormHelper.php

    r742780 r858784  
    1717     *
    1818     * @param string $name
    19      */
    20     public function __construct($name, $values) {
     19     * @param array $values
     20     */
     21    public function __construct($name, Array $values) {
    2122        $this->name = $name;
    2223        $this->values = $values;
     
    2425
    2526    /**
    26      * Value to Array
     27     * Arrayize
    2728     *
    2829     * @param string|array $value
     
    3031     * @return array
    3132     */
    32     public function toArray($value, $delimiter = '.') {
     33    public function arrayize($value, $delimiter = '.') {
    3334        return is_array($value) ? $value : explode($delimiter, $value);
    3435    }
    3536
    3637    /**
    37      * ID attributes
     38     * ID attribute
    3839     *
    3940     * @param string $name
     
    4142     */
    4243    public function id($name) {
    43         $arr = $this->toArray($name);
     44        $arr = $this->arrayize($name);
    4445        array_unshift($arr, $this->name);
    4546        return implode('-', $arr);
     
    4748
    4849    /**
    49      * Name attributes
     50     * Name attribute
    5051     *
    5152     * @param string $name
     
    5354     */
    5455    public function name($name) {
    55         return $this->name . '[' . implode('][', $this->toArray($name)) . ']';
    56     }
    57 
    58     /**
    59      * Value attributes
     56        return $this->name . '[' . implode('][', $this->arrayize($name)) . ']';
     57    }
     58
     59    /**
     60     * Value attribute
    6061     *
    6162     * @param string $name
     
    6364     */
    6465    public function value($name) {
    65         $names = $this->toArray($name);
     66        $names = $this->arrayize($name);
    6667        $value = $this->values;
    6768
    68         while(count($names) > 0) {
     69        while (count($names) > 0) {
    6970            $value = $value[array_shift($names)];
    7071        }
     
    188189     * @param string $label
    189190     * @param string $value
     191     * @param array $attributes
    190192     * @return string
    191193     */
     
    210212    public function select($name, $values, Array $attributes = array()) {
    211213        $attrs = $this->attributes($attributes + array('name' => $this->name($name)));
    212         $values = $this->toArray($values, ',');
     214        $values = $this->arrayize($values, ',');
    213215        $currentValue = $this->value($name);
    214216        $optionTags = array();
  • wp-emmet/trunk/WP/Emmet/Lang.php

    r659993 r858784  
    1212
    1313    /**
    14      * Load textdomain
     14     * Loads a MO file into the domain $domain
    1515     */
    1616    public function load() {
  • wp-emmet/trunk/WP/Emmet/Options.php

    r742780 r858784  
    6868            'codemirror_style' => "font-family: Ricty, \"VL Gothic\", monospace, sans-serif;\nfont-size: 16px;\nline-height: 1.3;\nletter-spacing: 1px;",
    6969
     70            'scope' => array(
     71                'post' => '1',
     72                'theme-editor' => '1',
     73                'plugin-editor' => '1'
     74            ),
     75
    7076            'override_shortcuts' => '',
    71 
    7277            'shortcuts' => array(
    7378                'Expand Abbreviation'      => 'Meta+E',
     
    133138     * @param string $key
    134139     * @param boolean $normalize
     140     * @return mixed
    135141     */
    136142    public function get($key = null, $normalize = false) {
     
    160166     *
    161167     * @param string $key
     168     * @return string
    162169     */
    163170    public function toJSON($key = null) {
  • wp-emmet/trunk/langs/default.pot

    r742780 r858784  
    22msgstr ""
    33"Project-Id-Version: WP Emmet\n"
    4 "POT-Creation-Date: 2013-07-18 23:04+0900\n"
    5 "PO-Revision-Date: 2013-07-18 23:04+0900\n"
     4"POT-Creation-Date: 2014-02-16 18:23+0900\n"
     5"PO-Revision-Date: 2014-02-16 18:23+0900\n"
    66"Last-Translator: rewish <rewish.org@gmail.com>\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.5.5\n"
     12"X-Generator: Poedit 1.5.7\n"
    1313"X-Poedit-KeywordsList: __;_e\n"
    1414"X-Poedit-Basepath: ../\n"
    1515"X-Poedit-SearchPath-0: .\n"
    1616
     17#: langs/fake.php:5
     18msgid "Expand Abbreviation"
     19msgstr ""
     20
     21#: langs/fake.php:6
     22msgid "Match Pair Outward"
     23msgstr ""
     24
     25#: langs/fake.php:7
     26msgid "Match Pair Inward"
     27msgstr ""
     28
     29#: langs/fake.php:8
     30msgid "Wrap with Abbreviation"
     31msgstr ""
     32
     33#: langs/fake.php:9
     34msgid "Next Edit Point"
     35msgstr ""
     36
     37#: langs/fake.php:10
     38msgid "Prev Edit Point"
     39msgstr ""
     40
     41#: langs/fake.php:11
     42msgid "Select Line"
     43msgstr ""
     44
     45#: langs/fake.php:12
     46msgid "Merge Lines"
     47msgstr ""
     48
     49#: langs/fake.php:13
     50msgid "Toggle Comment"
     51msgstr ""
     52
     53#: langs/fake.php:14
     54msgid "Split/Join Tag"
     55msgstr ""
     56
     57#: langs/fake.php:15
     58msgid "Remove Tag"
     59msgstr ""
     60
     61#: langs/fake.php:16
     62msgid "Evaluate Math Expression"
     63msgstr ""
     64
     65#: langs/fake.php:17
     66msgid "Increment number by 1"
     67msgstr ""
     68
     69#: langs/fake.php:18
     70msgid "Decrement number by 1"
     71msgstr ""
     72
     73#: langs/fake.php:19
     74msgid "Increment number by 0.1"
     75msgstr ""
     76
     77#: langs/fake.php:20
     78msgid "Decrement number by 0.1"
     79msgstr ""
     80
     81#: langs/fake.php:21
     82msgid "Increment number by 10"
     83msgstr ""
     84
     85#: langs/fake.php:22
     86msgid "Decrement number by 10"
     87msgstr ""
     88
     89#: langs/fake.php:23
     90msgid "Select Next Item"
     91msgstr ""
     92
     93#: langs/fake.php:24
     94msgid "Select Previous Item"
     95msgstr ""
     96
     97#: langs/fake.php:25
     98msgid "Reflect CSS Value"
     99msgstr ""
     100
    17101#: views/options.php:12
    18102msgid "Editor"
     
    55139msgstr ""
    56140
    57 #: views/options.php:59
     141#: views/options.php:60
    58142msgid "Tabs and Indents"
    59143msgstr ""
    60144
    61 #: views/options.php:62
     145#: views/options.php:63
    62146msgid "Use tab character"
    63147msgstr ""
    64148
    65 #: views/options.php:67
     149#: views/options.php:68
    66150msgid "Smart indent"
    67151msgstr ""
    68152
    69 #: views/options.php:71
     153#: views/options.php:72
    70154msgid "Tab size"
    71155msgstr ""
    72156
    73 #: views/options.php:76
     157#: views/options.php:77
    74158msgid "Indent unit"
    75159msgstr ""
    76160
    77 #: views/options.php:81
     161#: views/options.php:83
    78162msgid "Appearance"
    79163msgstr ""
    80164
    81 #: views/options.php:84
     165#: views/options.php:86
    82166msgid "Show line numbers"
    83167msgstr ""
    84168
    85 #: views/options.php:89
     169#: views/options.php:91
    86170msgid "Line wrapping"
    87171msgstr ""
    88172
    89 #: views/options.php:93
     173#: views/options.php:96
    90174msgid "Editor Style"
    91175msgstr ""
    92176
    93 #: views/options.php:103
     177#: views/options.php:105
     178msgid "Scope"
     179msgstr ""
     180
     181#: views/options.php:110
     182msgid "Post Editor"
     183msgstr ""
     184
     185#: views/options.php:115
     186msgid "Theme Editor"
     187msgstr ""
     188
     189#: views/options.php:120
     190msgid "Plugin Editor"
     191msgstr ""
     192
     193#: views/options.php:128
    94194msgid "Shortcuts"
    95195msgstr ""
    96196
    97 #: views/options.php:106
     197#: views/options.php:132
    98198msgid "Override shortcuts"
    99199msgstr ""
    100200
    101 #: views/options.php:120
     201#: views/options.php:146
    102202msgid "Save option"
    103203msgstr ""
    104204
    105 #: views/options.php:124
     205#: views/options.php:150
    106206msgid "Bug reports"
    107207msgstr ""
    108208
    109 #: views/options.php:125
     209#: views/options.php:151
    110210#, php-format
    111211msgid "Please create an issue on %s."
    112212msgstr ""
    113213
    114 #: views/options.php:127
     214#: views/options.php:153
    115215msgid "Test the Emmet"
    116216msgstr ""
    117 
    118 #: views/options.php:171
    119 msgid "Expand Abbreviation"
    120 msgstr ""
    121 
    122 #: views/options.php:172
    123 msgid "Match Pair Outward"
    124 msgstr ""
    125 
    126 #: views/options.php:173
    127 msgid "Match Pair Inward"
    128 msgstr ""
    129 
    130 #: views/options.php:174
    131 msgid "Wrap with Abbreviation"
    132 msgstr ""
    133 
    134 #: views/options.php:175
    135 msgid "Next Edit Point"
    136 msgstr ""
    137 
    138 #: views/options.php:176
    139 msgid "Prev Edit Point"
    140 msgstr ""
    141 
    142 #: views/options.php:177
    143 msgid "Select Line"
    144 msgstr ""
    145 
    146 #: views/options.php:178
    147 msgid "Merge Lines"
    148 msgstr ""
    149 
    150 #: views/options.php:179
    151 msgid "Toggle Comment"
    152 msgstr ""
    153 
    154 #: views/options.php:180
    155 msgid "Split/Join Tag"
    156 msgstr ""
    157 
    158 #: views/options.php:181
    159 msgid "Remove Tag"
    160 msgstr ""
    161 
    162 #: views/options.php:182
    163 msgid "Evaluate Math Expression"
    164 msgstr ""
    165 
    166 #: views/options.php:183
    167 msgid "Increment number by 1"
    168 msgstr ""
    169 
    170 #: views/options.php:184
    171 msgid "Decrement number by 1"
    172 msgstr ""
    173 
    174 #: views/options.php:185
    175 msgid "Increment number by 0.1"
    176 msgstr ""
    177 
    178 #: views/options.php:186
    179 msgid "Decrement number by 0.1"
    180 msgstr ""
    181 
    182 #: views/options.php:187
    183 msgid "Increment number by 10"
    184 msgstr ""
    185 
    186 #: views/options.php:188
    187 msgid "Decrement number by 10"
    188 msgstr ""
    189 
    190 #: views/options.php:189
    191 msgid "Select Next Item"
    192 msgstr ""
    193 
    194 #: views/options.php:190
    195 msgid "Select Previous Item"
    196 msgstr ""
    197 
    198 #: views/options.php:191
    199 msgid "Reflect CSS Value"
    200 msgstr ""
  • wp-emmet/trunk/langs/ja.po

    r742780 r858784  
    22msgstr ""
    33"Project-Id-Version: WP Emmet\n"
    4 "POT-Creation-Date: 2013-07-18 23:05+0900\n"
    5 "PO-Revision-Date: 2013-07-18 23:08+0900\n"
     4"POT-Creation-Date: 2014-02-16 18:26+0900\n"
     5"PO-Revision-Date: 2014-02-16 18:26+0900\n"
    66"Last-Translator: rewish <rewish.org@gmail.com>\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.5.5\n"
     12"X-Generator: Poedit 1.5.7\n"
    1313"X-Poedit-KeywordsList: __;_e\n"
    1414"X-Poedit-Basepath: ../\n"
    1515"X-Poedit-SearchPath-0: .\n"
    1616
     17#: langs/fake.php:5
     18msgid "Expand Abbreviation"
     19msgstr "省略コードの展開"
     20
     21#: langs/fake.php:6
     22msgid "Match Pair Outward"
     23msgstr "タグの外側を選択"
     24
     25#: langs/fake.php:7
     26msgid "Match Pair Inward"
     27msgstr "タグの内側を選択"
     28
     29#: langs/fake.php:8
     30msgid "Wrap with Abbreviation"
     31msgstr "省略コードで包括"
     32
     33#: langs/fake.php:9
     34msgid "Next Edit Point"
     35msgstr "次の編集箇所へ"
     36
     37#: langs/fake.php:10
     38msgid "Prev Edit Point"
     39msgstr "前の編集箇所へ"
     40
     41#: langs/fake.php:11
     42msgid "Select Line"
     43msgstr "行を選択"
     44
     45#: langs/fake.php:12
     46msgid "Merge Lines"
     47msgstr "要素を1行に結合"
     48
     49#: langs/fake.php:13
     50msgid "Toggle Comment"
     51msgstr "コメントアウトの実行/解除"
     52
     53#: langs/fake.php:14
     54msgid "Split/Join Tag"
     55msgstr "タグの結合/分解"
     56
     57#: langs/fake.php:15
     58msgid "Remove Tag"
     59msgstr "タグを削除"
     60
     61#: langs/fake.php:16
     62msgid "Evaluate Math Expression"
     63msgstr "数式を評価"
     64
     65#: langs/fake.php:17
     66msgid "Increment number by 1"
     67msgstr "数値を1増加"
     68
     69#: langs/fake.php:18
     70msgid "Decrement number by 1"
     71msgstr "数値を1減少"
     72
     73#: langs/fake.php:19
     74msgid "Increment number by 0.1"
     75msgstr "数値を0.1増加"
     76
     77#: langs/fake.php:20
     78msgid "Decrement number by 0.1"
     79msgstr "数値を0.1減少"
     80
     81#: langs/fake.php:21
     82msgid "Increment number by 10"
     83msgstr "数値を10増加"
     84
     85#: langs/fake.php:22
     86msgid "Decrement number by 10"
     87msgstr "数値を10減少"
     88
     89#: langs/fake.php:23
     90msgid "Select Next Item"
     91msgstr "次の項目を選択"
     92
     93#: langs/fake.php:24
     94msgid "Select Previous Item"
     95msgstr "前の項目を選択"
     96
     97#: langs/fake.php:25
     98msgid "Reflect CSS Value"
     99msgstr "CSSの値を反映"
     100
    17101#: views/options.php:12
    18102msgid "Editor"
     
    55139msgstr "テーマ"
    56140
    57 #: views/options.php:59
     141#: views/options.php:60
    58142msgid "Tabs and Indents"
    59143msgstr "タブとインデント"
    60144
    61 #: views/options.php:62
     145#: views/options.php:63
    62146msgid "Use tab character"
    63147msgstr "タブ文字を使用"
    64148
    65 #: views/options.php:67
     149#: views/options.php:68
    66150msgid "Smart indent"
    67151msgstr "スマートインデント"
    68152
    69 #: views/options.php:71
     153#: views/options.php:72
    70154msgid "Tab size"
    71155msgstr "タブサイズ"
    72156
    73 #: views/options.php:76
     157#: views/options.php:77
    74158msgid "Indent unit"
    75159msgstr "インデント幅"
    76160
    77 #: views/options.php:81
     161#: views/options.php:83
    78162msgid "Appearance"
    79163msgstr "外観"
    80164
    81 #: views/options.php:84
     165#: views/options.php:86
    82166msgid "Show line numbers"
    83167msgstr "行ナンバーを表示"
    84168
    85 #: views/options.php:89
     169#: views/options.php:91
    86170msgid "Line wrapping"
    87171msgstr "行を折り返す"
    88172
    89 #: views/options.php:93
     173#: views/options.php:96
    90174msgid "Editor Style"
    91175msgstr "エディタースタイル"
    92176
    93 #: views/options.php:103
     177#: views/options.php:105
     178msgid "Scope"
     179msgstr "適用範囲"
     180
     181#: views/options.php:110
     182msgid "Post Editor"
     183msgstr "投稿エディター"
     184
     185#: views/options.php:115
     186msgid "Theme Editor"
     187msgstr "テーマエディター"
     188
     189#: views/options.php:120
     190msgid "Plugin Editor"
     191msgstr "プラグインエディター"
     192
     193#: views/options.php:128
    94194msgid "Shortcuts"
    95195msgstr "ショートカット"
    96196
    97 #: views/options.php:106
     197#: views/options.php:132
    98198msgid "Override shortcuts"
    99199msgstr "ショートカットを上書き"
    100200
    101 #: views/options.php:120
     201#: views/options.php:146
    102202msgid "Save option"
    103203msgstr "オプションを保存"
    104204
    105 #: views/options.php:124
     205#: views/options.php:150
    106206msgid "Bug reports"
    107207msgstr "バグの報告"
    108208
    109 #: views/options.php:125
     209#: views/options.php:151
    110210#, php-format
    111211msgid "Please create an issue on %s."
    112212msgstr "%sから報告してください。"
    113213
    114 #: views/options.php:127
     214#: views/options.php:153
    115215msgid "Test the Emmet"
    116216msgstr "Emmetをテスト"
    117 
    118 #: views/options.php:171
    119 msgid "Expand Abbreviation"
    120 msgstr "省略コードの展開"
    121 
    122 #: views/options.php:172
    123 msgid "Match Pair Outward"
    124 msgstr "タグの外側を選択"
    125 
    126 #: views/options.php:173
    127 msgid "Match Pair Inward"
    128 msgstr "タグの内側を選択"
    129 
    130 #: views/options.php:174
    131 msgid "Wrap with Abbreviation"
    132 msgstr "省略コードで包括"
    133 
    134 #: views/options.php:175
    135 msgid "Next Edit Point"
    136 msgstr "次の編集箇所へ"
    137 
    138 #: views/options.php:176
    139 msgid "Prev Edit Point"
    140 msgstr "前の編集箇所へ"
    141 
    142 #: views/options.php:177
    143 msgid "Select Line"
    144 msgstr "行を選択"
    145 
    146 #: views/options.php:178
    147 msgid "Merge Lines"
    148 msgstr "要素を1行に結合"
    149 
    150 #: views/options.php:179
    151 msgid "Toggle Comment"
    152 msgstr "コメントアウトの実行/解除"
    153 
    154 #: views/options.php:180
    155 msgid "Split/Join Tag"
    156 msgstr "タグの結合/分解"
    157 
    158 #: views/options.php:181
    159 msgid "Remove Tag"
    160 msgstr "タグを削除"
    161 
    162 #: views/options.php:182
    163 msgid "Evaluate Math Expression"
    164 msgstr "数式を評価"
    165 
    166 #: views/options.php:183
    167 msgid "Increment number by 1"
    168 msgstr "数値を1増加"
    169 
    170 #: views/options.php:184
    171 msgid "Decrement number by 1"
    172 msgstr "数値を1減少"
    173 
    174 #: views/options.php:185
    175 msgid "Increment number by 0.1"
    176 msgstr "数値を0.1増加"
    177 
    178 #: views/options.php:186
    179 msgid "Decrement number by 0.1"
    180 msgstr "数値を0.1減少"
    181 
    182 #: views/options.php:187
    183 msgid "Increment number by 10"
    184 msgstr "数値を10増加"
    185 
    186 #: views/options.php:188
    187 msgid "Decrement number by 10"
    188 msgstr "数値を10減少"
    189 
    190 #: views/options.php:189
    191 msgid "Select Next Item"
    192 msgstr "次の項目を選択"
    193 
    194 #: views/options.php:190
    195 msgid "Select Previous Item"
    196 msgstr "前の項目を選択"
    197 
    198 #: views/options.php:191
    199 msgid "Reflect CSS Value"
    200 msgstr "CSSの値を反映"
  • wp-emmet/trunk/readme.txt

    r742780 r858784  
    33Tags: emmet, zen-coding, editor, post, plugin, coding
    44Requires at least: 3.5
    5 Tested up to: 3.5.2
     5Tested up to: 3.8.1
    66Stable tag: trunk
    77License: GPLv2 or later
     
    2828== Changelog ==
    2929
     30= 0.2.4 =
     31* Add the Scope option
     32
    3033= 0.2.3 =
    3134* Add option of editor style
  • wp-emmet/trunk/views/options.php

    r742780 r858784  
    5656                    <td><?php echo $form->select('codemirror.theme', $themes); ?></td>
    5757                </tr>
     58
    5859                <tr data-editor-type="codemirror">
    5960                    <th><?php _e('Tabs and Indents', $domain); ?></th>
     
    7879                    </td>
    7980                </tr>
     81
    8082                <tr data-editor-type="codemirror">
    8183                    <th><?php _e('Appearance'); ?></th>
     
    9092                    </td>
    9193                </tr>
     94
    9295                <tr data-editor-type="codemirror">
    9396                    <th><?php _e('Editor Style', $domain); ?></th>
     
    98101                    )); ?></td>
    99102                </tr>
     103
     104                <tr>
     105                    <th><?php _e('Scope', $domain); ?></th>
     106                    <td>
     107                        <fieldset>
     108                            <label>
     109                                <?php echo $form->checkBoolean('scope.post'); ?>
     110                                <?php _e('Post Editor', $domain); ?>
     111                            </label>
     112                            <br>
     113                            <label>
     114                                <?php echo $form->checkBoolean('scope.theme-editor'); ?>
     115                                <?php _e('Theme Editor', $domain); ?>
     116                            </label>
     117                            <br>
     118                            <label>
     119                                <?php echo $form->checkBoolean('scope.plugin-editor'); ?>
     120                                <?php _e('Plugin Editor', $domain); ?>
     121                            </label>
     122                        </fieldset>
     123                    </td>
     124                </tr>
    100125            </tbody>
    101126        </table>
     
    103128        <h3><?php _e('Shortcuts', $domain); ?></h3>
    104129        <p>
    105             <input type="hidden" name="<?php echo $this->name; ?>[override_shortcuts]" value=""><input type="checkbox" id="<?php echo $this->name; ?>_override_shortcuts" name="<?php echo $this->name; ?>[override_shortcuts]" value="1"<?php if ($this->options['override_shortcuts']) echo ' checked="checked"'; ?>>
     130            <input type="hidden" name="<?php echo $this->name; ?>[override_shortcuts]" value="">
     131            <input type="checkbox" data-wp-emmet-toggle="shortcuts" id="<?php echo $this->name; ?>_override_shortcuts" name="<?php echo $this->name; ?>[override_shortcuts]" value="1"<?php if ($this->options['override_shortcuts']) echo ' checked="checked"'; ?>>
    106132            <label for="<?php echo $this->name; ?>_override_shortcuts"><?php _e('Override shortcuts', $domain); ?></label>
    107133        <p>
    108         <table class="form-table <?php echo $this->name; ?>_shortcuts"<?php if (!$this->options['override_shortcuts']) echo ' style="display: none"'; ?>>
     134        <table data-wp-emmet-toggle-name="shortcuts" class="form-table <?php echo $this->name; ?>_shortcuts"<?php if (!$this->options['override_shortcuts']) echo ' style="display: none"'; ?>>
    109135            <tbody>
    110136<?php       foreach ($this->options['shortcuts'] as $label => $keystroke): ?>
     
    142168<script>
    143169jQuery(function($) {
    144     var $shortcuts = $('.<?php echo $this->name; ?>_shortcuts');
    145 
    146170    $('#<?php echo $form->id('use_codemirror'); ?>').on('click', function() {
    147171        $('[data-use-editor-type]').attr('data-use-editor-type', this.checked ? 'codemirror' : 'textarea');
     
    157181    });
    158182
    159     $('#<?php echo $this->name; ?>_override_shortcuts').on('click', function() {
    160         if ($(this).attr('checked')) {
    161             $shortcuts.show();
    162         } else {
    163             $shortcuts.hide();
    164         }
     183    $(document).on('click', '[data-wp-emmet-toggle]', function() {
     184        var $el = $(this),
     185            selector = '[data-wp-emmet-toggle-name="' + $el.attr('data-wp-emmet-toggle') + '"]';
     186        $(selector).toggle($el.prop('checked'));
    165187    });
    166188});
    167189</script>
    168 
    169 <?php
    170 // Fake call for gettext
    171 __('Expand Abbreviation');
    172 __('Match Pair Outward');
    173 __('Match Pair Inward');
    174 __('Wrap with Abbreviation');
    175 __('Next Edit Point');
    176 __('Prev Edit Point');
    177 __('Select Line');
    178 __('Merge Lines');
    179 __('Toggle Comment');
    180 __('Split/Join Tag');
    181 __('Remove Tag');
    182 __('Evaluate Math Expression');
    183 __('Increment number by 1');
    184 __('Decrement number by 1');
    185 __('Increment number by 0.1');
    186 __('Decrement number by 0.1');
    187 __('Increment number by 10');
    188 __('Decrement number by 10');
    189 __('Select Next Item');
    190 __('Select Previous Item');
    191 __('Reflect CSS Value');
    192 ?>
  • wp-emmet/trunk/wp-emmet.php

    r742780 r858784  
    44Plugin URI: https://github.com/rewish/wp-emmet
    55Description: Emmet (ex-Zen Coding) for WordPress.
    6 Version: 0.2.3
     6Version: 0.2.4
    77Author: rewish
    88Author URI: https://github.com/rewish
Note: See TracChangeset for help on using the changeset viewer.