Changeset 858784
- Timestamp:
- 02/16/2014 09:35:03 AM (12 years ago)
- Location:
- wp-emmet/trunk
- Files:
-
- 1 added
- 11 edited
-
WP/Emmet.php (modified) (4 diffs)
-
WP/Emmet/CodeMirror.php (modified) (7 diffs)
-
WP/Emmet/FormHelper.php (modified) (9 diffs)
-
WP/Emmet/Lang.php (modified) (1 diff)
-
WP/Emmet/Options.php (modified) (3 diffs)
-
langs/default.pot (modified) (3 diffs)
-
langs/fake.php (added)
-
langs/ja.mo (modified) (previous)
-
langs/ja.po (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
views/options.php (modified) (7 diffs)
-
wp-emmet.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-emmet/trunk/WP/Emmet.php
r739200 r858784 83 83 WP_Emmet_Migration::migrate($this); 84 84 85 $this->registerHooks();85 add_action('current_screen', array($this, 'registerHooks')); 86 86 } 87 87 … … 90 90 */ 91 91 public function registerHooks() { 92 if (!$this->isInScope()) { 93 return; 94 } 95 92 96 add_action('admin_print_styles', array($this, 'printStyles')); 93 97 add_action('admin_enqueue_scripts', array($this, 'enqueueScripts')); 94 98 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'; 95 110 } 96 111 … … 132 147 * @return string 133 148 */ 134 p rotectedfunction editorType() {149 public function editorType() { 135 150 return $this->isCodeMirrorMode() ? 'codemirror' : 'textarea'; 136 151 } … … 141 156 * @return bool 142 157 */ 143 p rotectedfunction isCodeMirrorMode() {158 public function isCodeMirrorMode() { 144 159 return $this->Options->get('use_codemirror') === '1'; 145 160 } -
wp-emmet/trunk/WP/Emmet/CodeMirror.php
r738398 r858784 29 29 } 30 30 31 /** 32 * Initialization 33 */ 31 34 public function init() { 32 35 $this->registerStyle('codemirror'); 33 $this-> registerThemes();36 $this->_registerThemes(); 34 37 $this->registerScript('codemirror'); 35 $this-> registerModes();38 $this->_registerModes(); 36 39 } 37 40 … … 44 47 public function registerStyle($fileName, $theme = null) { 45 48 $domain = $theme ? "{$this->domain}-{$theme}" : $this->domain; 46 WP_Emmet::registerStyle($domain, $this-> styleFileURL($fileName));49 WP_Emmet::registerStyle($domain, $this->_styleFileURL($fileName)); 47 50 } 48 51 … … 55 58 public function registerScript($fileName, $mode = null) { 56 59 $domain = $mode ? "{$this->domain}-{$mode}" : $this->domain; 57 WP_Emmet::registerScript($domain, $this-> scriptFileURL($fileName));60 WP_Emmet::registerScript($domain, $this->_scriptFileURL($fileName)); 58 61 } 59 62 … … 90 93 * @return string 91 94 */ 92 protected function styleFileURL($name) {95 protected function _styleFileURL($name) { 93 96 return WP_Emmet::assetURL("css/codemirror/{$name}.css"); 94 97 } … … 100 103 * @return string 101 104 */ 102 protected function scriptFileURL($name) {105 protected function _scriptFileURL($name) { 103 106 return WP_Emmet::assetURL("js/codemirror/{$name}.js"); 104 107 } … … 107 110 * Register themes 108 111 */ 109 protected function registerThemes() {112 protected function _registerThemes() { 110 113 $this->themes = array('default' => 'default'); 111 114 $themes = glob(WP_Emmet::assetPath('css/codemirror/theme/*.css')); … … 121 124 * Register modes 122 125 */ 123 protected function registerModes() {126 protected function _registerModes() { 124 127 $modes = glob(WP_Emmet::assetPath('js/codemirror/mode/*.js')); 125 128 -
wp-emmet/trunk/WP/Emmet/FormHelper.php
r742780 r858784 17 17 * 18 18 * @param string $name 19 */ 20 public function __construct($name, $values) { 19 * @param array $values 20 */ 21 public function __construct($name, Array $values) { 21 22 $this->name = $name; 22 23 $this->values = $values; … … 24 25 25 26 /** 26 * Value to Array27 * Arrayize 27 28 * 28 29 * @param string|array $value … … 30 31 * @return array 31 32 */ 32 public function toArray($value, $delimiter = '.') {33 public function arrayize($value, $delimiter = '.') { 33 34 return is_array($value) ? $value : explode($delimiter, $value); 34 35 } 35 36 36 37 /** 37 * ID attribute s38 * ID attribute 38 39 * 39 40 * @param string $name … … 41 42 */ 42 43 public function id($name) { 43 $arr = $this-> toArray($name);44 $arr = $this->arrayize($name); 44 45 array_unshift($arr, $this->name); 45 46 return implode('-', $arr); … … 47 48 48 49 /** 49 * Name attribute s50 * Name attribute 50 51 * 51 52 * @param string $name … … 53 54 */ 54 55 public function name($name) { 55 return $this->name . '[' . implode('][', $this-> toArray($name)) . ']';56 } 57 58 /** 59 * Value attribute s56 return $this->name . '[' . implode('][', $this->arrayize($name)) . ']'; 57 } 58 59 /** 60 * Value attribute 60 61 * 61 62 * @param string $name … … 63 64 */ 64 65 public function value($name) { 65 $names = $this-> toArray($name);66 $names = $this->arrayize($name); 66 67 $value = $this->values; 67 68 68 while (count($names) > 0) {69 while (count($names) > 0) { 69 70 $value = $value[array_shift($names)]; 70 71 } … … 188 189 * @param string $label 189 190 * @param string $value 191 * @param array $attributes 190 192 * @return string 191 193 */ … … 210 212 public function select($name, $values, Array $attributes = array()) { 211 213 $attrs = $this->attributes($attributes + array('name' => $this->name($name))); 212 $values = $this-> toArray($values, ',');214 $values = $this->arrayize($values, ','); 213 215 $currentValue = $this->value($name); 214 216 $optionTags = array(); -
wp-emmet/trunk/WP/Emmet/Lang.php
r659993 r858784 12 12 13 13 /** 14 * Load textdomain14 * Loads a MO file into the domain $domain 15 15 */ 16 16 public function load() { -
wp-emmet/trunk/WP/Emmet/Options.php
r742780 r858784 68 68 'codemirror_style' => "font-family: Ricty, \"VL Gothic\", monospace, sans-serif;\nfont-size: 16px;\nline-height: 1.3;\nletter-spacing: 1px;", 69 69 70 'scope' => array( 71 'post' => '1', 72 'theme-editor' => '1', 73 'plugin-editor' => '1' 74 ), 75 70 76 'override_shortcuts' => '', 71 72 77 'shortcuts' => array( 73 78 'Expand Abbreviation' => 'Meta+E', … … 133 138 * @param string $key 134 139 * @param boolean $normalize 140 * @return mixed 135 141 */ 136 142 public function get($key = null, $normalize = false) { … … 160 166 * 161 167 * @param string $key 168 * @return string 162 169 */ 163 170 public function toJSON($key = null) { -
wp-emmet/trunk/langs/default.pot
r742780 r858784 2 2 msgstr "" 3 3 "Project-Id-Version: WP Emmet\n" 4 "POT-Creation-Date: 201 3-07-18 23:04+0900\n"5 "PO-Revision-Date: 201 3-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" 6 6 "Last-Translator: rewish <rewish.org@gmail.com>\n" 7 7 "Language-Team: \n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1.5. 5\n"12 "X-Generator: Poedit 1.5.7\n" 13 13 "X-Poedit-KeywordsList: __;_e\n" 14 14 "X-Poedit-Basepath: ../\n" 15 15 "X-Poedit-SearchPath-0: .\n" 16 16 17 #: langs/fake.php:5 18 msgid "Expand Abbreviation" 19 msgstr "" 20 21 #: langs/fake.php:6 22 msgid "Match Pair Outward" 23 msgstr "" 24 25 #: langs/fake.php:7 26 msgid "Match Pair Inward" 27 msgstr "" 28 29 #: langs/fake.php:8 30 msgid "Wrap with Abbreviation" 31 msgstr "" 32 33 #: langs/fake.php:9 34 msgid "Next Edit Point" 35 msgstr "" 36 37 #: langs/fake.php:10 38 msgid "Prev Edit Point" 39 msgstr "" 40 41 #: langs/fake.php:11 42 msgid "Select Line" 43 msgstr "" 44 45 #: langs/fake.php:12 46 msgid "Merge Lines" 47 msgstr "" 48 49 #: langs/fake.php:13 50 msgid "Toggle Comment" 51 msgstr "" 52 53 #: langs/fake.php:14 54 msgid "Split/Join Tag" 55 msgstr "" 56 57 #: langs/fake.php:15 58 msgid "Remove Tag" 59 msgstr "" 60 61 #: langs/fake.php:16 62 msgid "Evaluate Math Expression" 63 msgstr "" 64 65 #: langs/fake.php:17 66 msgid "Increment number by 1" 67 msgstr "" 68 69 #: langs/fake.php:18 70 msgid "Decrement number by 1" 71 msgstr "" 72 73 #: langs/fake.php:19 74 msgid "Increment number by 0.1" 75 msgstr "" 76 77 #: langs/fake.php:20 78 msgid "Decrement number by 0.1" 79 msgstr "" 80 81 #: langs/fake.php:21 82 msgid "Increment number by 10" 83 msgstr "" 84 85 #: langs/fake.php:22 86 msgid "Decrement number by 10" 87 msgstr "" 88 89 #: langs/fake.php:23 90 msgid "Select Next Item" 91 msgstr "" 92 93 #: langs/fake.php:24 94 msgid "Select Previous Item" 95 msgstr "" 96 97 #: langs/fake.php:25 98 msgid "Reflect CSS Value" 99 msgstr "" 100 17 101 #: views/options.php:12 18 102 msgid "Editor" … … 55 139 msgstr "" 56 140 57 #: views/options.php: 59141 #: views/options.php:60 58 142 msgid "Tabs and Indents" 59 143 msgstr "" 60 144 61 #: views/options.php:6 2145 #: views/options.php:63 62 146 msgid "Use tab character" 63 147 msgstr "" 64 148 65 #: views/options.php:6 7149 #: views/options.php:68 66 150 msgid "Smart indent" 67 151 msgstr "" 68 152 69 #: views/options.php:7 1153 #: views/options.php:72 70 154 msgid "Tab size" 71 155 msgstr "" 72 156 73 #: views/options.php:7 6157 #: views/options.php:77 74 158 msgid "Indent unit" 75 159 msgstr "" 76 160 77 #: views/options.php:8 1161 #: views/options.php:83 78 162 msgid "Appearance" 79 163 msgstr "" 80 164 81 #: views/options.php:8 4165 #: views/options.php:86 82 166 msgid "Show line numbers" 83 167 msgstr "" 84 168 85 #: views/options.php: 89169 #: views/options.php:91 86 170 msgid "Line wrapping" 87 171 msgstr "" 88 172 89 #: views/options.php:9 3173 #: views/options.php:96 90 174 msgid "Editor Style" 91 175 msgstr "" 92 176 93 #: views/options.php:103 177 #: views/options.php:105 178 msgid "Scope" 179 msgstr "" 180 181 #: views/options.php:110 182 msgid "Post Editor" 183 msgstr "" 184 185 #: views/options.php:115 186 msgid "Theme Editor" 187 msgstr "" 188 189 #: views/options.php:120 190 msgid "Plugin Editor" 191 msgstr "" 192 193 #: views/options.php:128 94 194 msgid "Shortcuts" 95 195 msgstr "" 96 196 97 #: views/options.php:1 06197 #: views/options.php:132 98 198 msgid "Override shortcuts" 99 199 msgstr "" 100 200 101 #: views/options.php:1 20201 #: views/options.php:146 102 202 msgid "Save option" 103 203 msgstr "" 104 204 105 #: views/options.php:1 24205 #: views/options.php:150 106 206 msgid "Bug reports" 107 207 msgstr "" 108 208 109 #: views/options.php:1 25209 #: views/options.php:151 110 210 #, php-format 111 211 msgid "Please create an issue on %s." 112 212 msgstr "" 113 213 114 #: views/options.php:1 27214 #: views/options.php:153 115 215 msgid "Test the Emmet" 116 216 msgstr "" 117 118 #: views/options.php:171119 msgid "Expand Abbreviation"120 msgstr ""121 122 #: views/options.php:172123 msgid "Match Pair Outward"124 msgstr ""125 126 #: views/options.php:173127 msgid "Match Pair Inward"128 msgstr ""129 130 #: views/options.php:174131 msgid "Wrap with Abbreviation"132 msgstr ""133 134 #: views/options.php:175135 msgid "Next Edit Point"136 msgstr ""137 138 #: views/options.php:176139 msgid "Prev Edit Point"140 msgstr ""141 142 #: views/options.php:177143 msgid "Select Line"144 msgstr ""145 146 #: views/options.php:178147 msgid "Merge Lines"148 msgstr ""149 150 #: views/options.php:179151 msgid "Toggle Comment"152 msgstr ""153 154 #: views/options.php:180155 msgid "Split/Join Tag"156 msgstr ""157 158 #: views/options.php:181159 msgid "Remove Tag"160 msgstr ""161 162 #: views/options.php:182163 msgid "Evaluate Math Expression"164 msgstr ""165 166 #: views/options.php:183167 msgid "Increment number by 1"168 msgstr ""169 170 #: views/options.php:184171 msgid "Decrement number by 1"172 msgstr ""173 174 #: views/options.php:185175 msgid "Increment number by 0.1"176 msgstr ""177 178 #: views/options.php:186179 msgid "Decrement number by 0.1"180 msgstr ""181 182 #: views/options.php:187183 msgid "Increment number by 10"184 msgstr ""185 186 #: views/options.php:188187 msgid "Decrement number by 10"188 msgstr ""189 190 #: views/options.php:189191 msgid "Select Next Item"192 msgstr ""193 194 #: views/options.php:190195 msgid "Select Previous Item"196 msgstr ""197 198 #: views/options.php:191199 msgid "Reflect CSS Value"200 msgstr "" -
wp-emmet/trunk/langs/ja.po
r742780 r858784 2 2 msgstr "" 3 3 "Project-Id-Version: WP Emmet\n" 4 "POT-Creation-Date: 201 3-07-18 23:05+0900\n"5 "PO-Revision-Date: 201 3-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" 6 6 "Last-Translator: rewish <rewish.org@gmail.com>\n" 7 7 "Language-Team: \n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1.5. 5\n"12 "X-Generator: Poedit 1.5.7\n" 13 13 "X-Poedit-KeywordsList: __;_e\n" 14 14 "X-Poedit-Basepath: ../\n" 15 15 "X-Poedit-SearchPath-0: .\n" 16 16 17 #: langs/fake.php:5 18 msgid "Expand Abbreviation" 19 msgstr "省略コードの展開" 20 21 #: langs/fake.php:6 22 msgid "Match Pair Outward" 23 msgstr "タグの外側を選択" 24 25 #: langs/fake.php:7 26 msgid "Match Pair Inward" 27 msgstr "タグの内側を選択" 28 29 #: langs/fake.php:8 30 msgid "Wrap with Abbreviation" 31 msgstr "省略コードで包括" 32 33 #: langs/fake.php:9 34 msgid "Next Edit Point" 35 msgstr "次の編集箇所へ" 36 37 #: langs/fake.php:10 38 msgid "Prev Edit Point" 39 msgstr "前の編集箇所へ" 40 41 #: langs/fake.php:11 42 msgid "Select Line" 43 msgstr "行を選択" 44 45 #: langs/fake.php:12 46 msgid "Merge Lines" 47 msgstr "要素を1行に結合" 48 49 #: langs/fake.php:13 50 msgid "Toggle Comment" 51 msgstr "コメントアウトの実行/解除" 52 53 #: langs/fake.php:14 54 msgid "Split/Join Tag" 55 msgstr "タグの結合/分解" 56 57 #: langs/fake.php:15 58 msgid "Remove Tag" 59 msgstr "タグを削除" 60 61 #: langs/fake.php:16 62 msgid "Evaluate Math Expression" 63 msgstr "数式を評価" 64 65 #: langs/fake.php:17 66 msgid "Increment number by 1" 67 msgstr "数値を1増加" 68 69 #: langs/fake.php:18 70 msgid "Decrement number by 1" 71 msgstr "数値を1減少" 72 73 #: langs/fake.php:19 74 msgid "Increment number by 0.1" 75 msgstr "数値を0.1増加" 76 77 #: langs/fake.php:20 78 msgid "Decrement number by 0.1" 79 msgstr "数値を0.1減少" 80 81 #: langs/fake.php:21 82 msgid "Increment number by 10" 83 msgstr "数値を10増加" 84 85 #: langs/fake.php:22 86 msgid "Decrement number by 10" 87 msgstr "数値を10減少" 88 89 #: langs/fake.php:23 90 msgid "Select Next Item" 91 msgstr "次の項目を選択" 92 93 #: langs/fake.php:24 94 msgid "Select Previous Item" 95 msgstr "前の項目を選択" 96 97 #: langs/fake.php:25 98 msgid "Reflect CSS Value" 99 msgstr "CSSの値を反映" 100 17 101 #: views/options.php:12 18 102 msgid "Editor" … … 55 139 msgstr "テーマ" 56 140 57 #: views/options.php: 59141 #: views/options.php:60 58 142 msgid "Tabs and Indents" 59 143 msgstr "タブとインデント" 60 144 61 #: views/options.php:6 2145 #: views/options.php:63 62 146 msgid "Use tab character" 63 147 msgstr "タブ文字を使用" 64 148 65 #: views/options.php:6 7149 #: views/options.php:68 66 150 msgid "Smart indent" 67 151 msgstr "スマートインデント" 68 152 69 #: views/options.php:7 1153 #: views/options.php:72 70 154 msgid "Tab size" 71 155 msgstr "タブサイズ" 72 156 73 #: views/options.php:7 6157 #: views/options.php:77 74 158 msgid "Indent unit" 75 159 msgstr "インデント幅" 76 160 77 #: views/options.php:8 1161 #: views/options.php:83 78 162 msgid "Appearance" 79 163 msgstr "外観" 80 164 81 #: views/options.php:8 4165 #: views/options.php:86 82 166 msgid "Show line numbers" 83 167 msgstr "行ナンバーを表示" 84 168 85 #: views/options.php: 89169 #: views/options.php:91 86 170 msgid "Line wrapping" 87 171 msgstr "行を折り返す" 88 172 89 #: views/options.php:9 3173 #: views/options.php:96 90 174 msgid "Editor Style" 91 175 msgstr "エディタースタイル" 92 176 93 #: views/options.php:103 177 #: views/options.php:105 178 msgid "Scope" 179 msgstr "適用範囲" 180 181 #: views/options.php:110 182 msgid "Post Editor" 183 msgstr "投稿エディター" 184 185 #: views/options.php:115 186 msgid "Theme Editor" 187 msgstr "テーマエディター" 188 189 #: views/options.php:120 190 msgid "Plugin Editor" 191 msgstr "プラグインエディター" 192 193 #: views/options.php:128 94 194 msgid "Shortcuts" 95 195 msgstr "ショートカット" 96 196 97 #: views/options.php:1 06197 #: views/options.php:132 98 198 msgid "Override shortcuts" 99 199 msgstr "ショートカットを上書き" 100 200 101 #: views/options.php:1 20201 #: views/options.php:146 102 202 msgid "Save option" 103 203 msgstr "オプションを保存" 104 204 105 #: views/options.php:1 24205 #: views/options.php:150 106 206 msgid "Bug reports" 107 207 msgstr "バグの報告" 108 208 109 #: views/options.php:1 25209 #: views/options.php:151 110 210 #, php-format 111 211 msgid "Please create an issue on %s." 112 212 msgstr "%sから報告してください。" 113 213 114 #: views/options.php:1 27214 #: views/options.php:153 115 215 msgid "Test the Emmet" 116 216 msgstr "Emmetをテスト" 117 118 #: views/options.php:171119 msgid "Expand Abbreviation"120 msgstr "省略コードの展開"121 122 #: views/options.php:172123 msgid "Match Pair Outward"124 msgstr "タグの外側を選択"125 126 #: views/options.php:173127 msgid "Match Pair Inward"128 msgstr "タグの内側を選択"129 130 #: views/options.php:174131 msgid "Wrap with Abbreviation"132 msgstr "省略コードで包括"133 134 #: views/options.php:175135 msgid "Next Edit Point"136 msgstr "次の編集箇所へ"137 138 #: views/options.php:176139 msgid "Prev Edit Point"140 msgstr "前の編集箇所へ"141 142 #: views/options.php:177143 msgid "Select Line"144 msgstr "行を選択"145 146 #: views/options.php:178147 msgid "Merge Lines"148 msgstr "要素を1行に結合"149 150 #: views/options.php:179151 msgid "Toggle Comment"152 msgstr "コメントアウトの実行/解除"153 154 #: views/options.php:180155 msgid "Split/Join Tag"156 msgstr "タグの結合/分解"157 158 #: views/options.php:181159 msgid "Remove Tag"160 msgstr "タグを削除"161 162 #: views/options.php:182163 msgid "Evaluate Math Expression"164 msgstr "数式を評価"165 166 #: views/options.php:183167 msgid "Increment number by 1"168 msgstr "数値を1増加"169 170 #: views/options.php:184171 msgid "Decrement number by 1"172 msgstr "数値を1減少"173 174 #: views/options.php:185175 msgid "Increment number by 0.1"176 msgstr "数値を0.1増加"177 178 #: views/options.php:186179 msgid "Decrement number by 0.1"180 msgstr "数値を0.1減少"181 182 #: views/options.php:187183 msgid "Increment number by 10"184 msgstr "数値を10増加"185 186 #: views/options.php:188187 msgid "Decrement number by 10"188 msgstr "数値を10減少"189 190 #: views/options.php:189191 msgid "Select Next Item"192 msgstr "次の項目を選択"193 194 #: views/options.php:190195 msgid "Select Previous Item"196 msgstr "前の項目を選択"197 198 #: views/options.php:191199 msgid "Reflect CSS Value"200 msgstr "CSSの値を反映" -
wp-emmet/trunk/readme.txt
r742780 r858784 3 3 Tags: emmet, zen-coding, editor, post, plugin, coding 4 4 Requires at least: 3.5 5 Tested up to: 3. 5.25 Tested up to: 3.8.1 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 28 28 == Changelog == 29 29 30 = 0.2.4 = 31 * Add the Scope option 32 30 33 = 0.2.3 = 31 34 * Add option of editor style -
wp-emmet/trunk/views/options.php
r742780 r858784 56 56 <td><?php echo $form->select('codemirror.theme', $themes); ?></td> 57 57 </tr> 58 58 59 <tr data-editor-type="codemirror"> 59 60 <th><?php _e('Tabs and Indents', $domain); ?></th> … … 78 79 </td> 79 80 </tr> 81 80 82 <tr data-editor-type="codemirror"> 81 83 <th><?php _e('Appearance'); ?></th> … … 90 92 </td> 91 93 </tr> 94 92 95 <tr data-editor-type="codemirror"> 93 96 <th><?php _e('Editor Style', $domain); ?></th> … … 98 101 )); ?></td> 99 102 </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> 100 125 </tbody> 101 126 </table> … … 103 128 <h3><?php _e('Shortcuts', $domain); ?></h3> 104 129 <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"'; ?>> 106 132 <label for="<?php echo $this->name; ?>_override_shortcuts"><?php _e('Override shortcuts', $domain); ?></label> 107 133 <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"'; ?>> 109 135 <tbody> 110 136 <?php foreach ($this->options['shortcuts'] as $label => $keystroke): ?> … … 142 168 <script> 143 169 jQuery(function($) { 144 var $shortcuts = $('.<?php echo $this->name; ?>_shortcuts');145 146 170 $('#<?php echo $form->id('use_codemirror'); ?>').on('click', function() { 147 171 $('[data-use-editor-type]').attr('data-use-editor-type', this.checked ? 'codemirror' : 'textarea'); … … 157 181 }); 158 182 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')); 165 187 }); 166 188 }); 167 189 </script> 168 169 <?php170 // Fake call for gettext171 __('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 4 4 Plugin URI: https://github.com/rewish/wp-emmet 5 5 Description: Emmet (ex-Zen Coding) for WordPress. 6 Version: 0.2. 36 Version: 0.2.4 7 7 Author: rewish 8 8 Author URI: https://github.com/rewish
Note: See TracChangeset
for help on using the changeset viewer.