1
0

edit.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <html id="stylus">
  2. <head>
  3. <meta charset="UTF-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5. <link rel="stylesheet" href="global.css">
  6. <link rel="stylesheet" href="edit/edit.css">
  7. <style id="firefox-transitions-bug-suppressor">
  8. /* restrict to FF */
  9. @supports (-moz-appearance:none) {
  10. /* increased specificity to override sane selectors in user styles */
  11. html#stylus.firefox #stylus-edit #header *,
  12. html#stylus.firefox #stylus-edit #sections * {
  13. transition: none !important;
  14. }
  15. }
  16. </style>
  17. <script src="js/dom.js"></script>
  18. <script src="js/messaging.js"></script>
  19. <script src="js/prefs.js"></script>
  20. <script src="js/localization.js"></script>
  21. <script src="js/script-loader.js"></script>
  22. <script src="js/moz-parser.js"></script>
  23. <script src="content/apply.js"></script>
  24. <script src="edit/lint.js"></script>
  25. <script src="edit/util.js"></script>
  26. <script src="edit/regexp-tester.js"></script>
  27. <script src="edit/applies-to-line-widget.js"></script>
  28. <script src="edit/source-editor.js"></script>
  29. <script src="edit/colorpicker-helper.js"></script>
  30. <script src="edit/beautify.js"></script>
  31. <script src="edit/sections.js"></script>
  32. <script src="edit/show-keymap-help.js"></script>
  33. <script src="edit/codemirror-editing-hooks.js"></script>
  34. <script src="edit/edit.js"></script>
  35. <script src="vendor/codemirror/lib/codemirror.js"></script>
  36. <link rel="stylesheet" href="vendor/codemirror/lib/codemirror.css">
  37. <script src="vendor/codemirror/mode/css/css.js"></script>
  38. <link rel="stylesheet" href="vendor/codemirror/addon/dialog/dialog.css">
  39. <link rel="stylesheet" href="vendor/codemirror/addon/search/matchesonscrollbar.css">
  40. <script src="vendor/codemirror/addon/scroll/annotatescrollbar.js"></script>
  41. <script src="vendor/codemirror/addon/search/matchesonscrollbar.js"></script>
  42. <script src="vendor/codemirror/addon/search/match-highlighter.js"></script>
  43. <script src="vendor/codemirror/addon/dialog/dialog.js"></script>
  44. <script src="vendor/codemirror/addon/search/searchcursor.js"></script>
  45. <script src="vendor/codemirror/addon/search/search.js"></script>
  46. <script src="vendor/codemirror/addon/comment/comment.js"></script>
  47. <script src="vendor/codemirror/addon/selection/active-line.js"></script>
  48. <link rel="stylesheet" href="vendor/codemirror/addon/fold/foldgutter.css" />
  49. <script src="vendor/codemirror/addon/fold/foldcode.js"></script>
  50. <script src="vendor/codemirror/addon/fold/foldgutter.js"></script>
  51. <script src="vendor/codemirror/addon/fold/brace-fold.js"></script>
  52. <script src="vendor/codemirror/addon/fold/comment-fold.js"></script>
  53. <script src="vendor/codemirror/addon/edit/matchbrackets.js"></script>
  54. <link rel="stylesheet" href="vendor/codemirror/addon/lint/lint.css" />
  55. <link rel="stylesheet" href="vendor/codemirror/addon/hint/show-hint.css" />
  56. <script src="vendor/codemirror/addon/hint/show-hint.js"></script>
  57. <script src="vendor/codemirror/addon/hint/css-hint.js"></script>
  58. <script src="vendor/codemirror/keymap/sublime.js"></script>
  59. <script src="vendor/codemirror/keymap/emacs.js"></script>
  60. <script src="vendor/codemirror/keymap/vim.js"></script>
  61. <link href="/vendor-overwrites/colorpicker/colorpicker.css" rel="stylesheet">
  62. <script src="/vendor-overwrites/colorpicker/colorpicker.js"></script>
  63. <script src="/vendor-overwrites/colorpicker/colorview.js"></script>
  64. <script src="edit/match-highlighter-helper.js"></script>
  65. <script src="edit/codemirror-default.js"></script>
  66. <link rel="stylesheet" href="/edit/codemirror-default.css">
  67. <template data-id="appliesTo">
  68. <li class="applies-to-item">
  69. <div class="select-resizer">
  70. <select name="applies-type" class="applies-type style-contributor">
  71. <option value="url" i18n-text="appliesUrlOption"></option>
  72. <option value="url-prefix" i18n-text="appliesUrlPrefixOption"></option>
  73. <option value="domain" i18n-text="appliesDomainOption"></option>
  74. <option value="regexp" i18n-text="appliesRegexpOption"></option>
  75. </select>
  76. <svg class="svg-icon select-arrow"><use xlink:href="#svg-icon-select-arrow"/></svg>
  77. </div>
  78. <input name="applies-value" class="applies-value style-contributor" spellcheck="false">
  79. <button class="remove-applies-to" i18n-text="appliesRemove"></button>
  80. <button class="add-applies-to" i18n-text="appliesAdd"></button>
  81. </li>
  82. </template>
  83. <template data-id="appliesToEverything">
  84. <li class="applies-to-everything" i18n-text="appliesToEverything">
  85. <button class="add-applies-to" i18n-text="appliesSpecify"></button>
  86. </li>
  87. </template>
  88. <template data-id="section">
  89. <div>
  90. <label i18n-text="sectionCode" class="code-label"></label>
  91. <br>
  92. <div class="applies-to">
  93. <label i18n-text="appliesLabel">
  94. <svg class="svg-icon info applies-to-help"><use xlink:href="#svg-icon-help"/></svg>
  95. </label>
  96. <ul class="applies-to-list"></ul>
  97. </div>
  98. <button class="remove-section" i18n-text="sectionRemove"></button>
  99. <button class="add-section" i18n-text="sectionAdd"></button>
  100. <button class="beautify-section" i18n-text="styleBeautify"></button>
  101. <button class="test-regexp" i18n-text="styleRegexpTestButton"></button>
  102. </div>
  103. </template>
  104. <template data-id="find">
  105. <span i18n-text="search">: <input type="text" class="CodeMirror-search-field" spellcheck="false">
  106. <span class="CodeMirror-search-hint">(<span i18n-text="searchRegexp"></span>)</span>
  107. </span>
  108. </template>
  109. <template data-id="replace">
  110. <span i18n-text="replace">: <input type="text" class="CodeMirror-search-field" spellcheck="false">
  111. <span class="CodeMirror-search-hint">(<span i18n-text="searchRegexp"></span>)</span>
  112. </span>
  113. </template>
  114. <template data-id="replaceAll">
  115. <span i18n-text="replaceAll">: <input type="text" class="CodeMirror-search-field" spellcheck="false">
  116. <span class="CodeMirror-search-hint">(<span i18n-text="searchRegexp"></span>)</span>
  117. </span>
  118. </template>
  119. <template data-id="replaceWith">
  120. <span i18n-text="replaceWith">: <input type="text" class="CodeMirror-search-field" spellcheck="false">
  121. </span>
  122. </template>
  123. <template data-id="replaceConfirm">
  124. <span i18n-text="replace">?
  125. <button i18n-text="confirmYes"></button>
  126. <button i18n-text="confirmNo"></button>
  127. <button i18n-text="confirmStop"></button>
  128. </span>
  129. </template>
  130. <template data-id="jumpToLine">
  131. <span i18n-text="editGotoLine">: <input class="CodeMirror-jump-field" type="text"></span>
  132. </template>
  133. <template data-id="regexpTestPartial">
  134. <a target="_blank" href="https://github.com/stylish-userstyles/stylish/wiki/Applying-styles-to-specific-sites#advanced-matching-with-regular-expressions"><svg class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></a>
  135. </template>
  136. <template data-id="resizeGrip">
  137. <div class="resize-grip" i18n-title="cm_resizeGripHint"></div>
  138. </template>
  139. <template data-id="keymapHelp">
  140. <table class="keymap-list">
  141. <thead>
  142. <tr>
  143. <th><input i18n-placeholder="helpKeyMapHotkey" type="search" class="can-close-on-esc"></th>
  144. <th><input i18n-placeholder="helpKeyMapCommand" type="search" class="can-close-on-esc" spellcheck="false"></th>
  145. </tr>
  146. </thead>
  147. <tbody>
  148. <tr>
  149. <td></td>
  150. <td></td>
  151. </tr>
  152. </tbody>
  153. </table>
  154. </template>
  155. </head>
  156. <body id="stylus-edit">
  157. <div id="header">
  158. <h1 id="heading">&nbsp;</h1> <!-- nbsp allocates the actual height which prevents page shift -->
  159. <section id="basic-info">
  160. <div id="basic-info-name">
  161. <input id="name" class="style-contributor" spellcheck="false">
  162. <a id="url" target="_blank"><svg class="svg-icon"><use xlink:href="#svg-icon-external-link"/></svg></a>
  163. </div>
  164. <div id="basic-info-enabled">
  165. <label id="enabled-label" i18n-text="styleEnabledLabel">
  166. <input type="checkbox" id="enabled" class="style-contributor">
  167. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  168. </label><!--
  169. --><svg id="toggle-style-help" class="svg-icon info">
  170. <use xlink:href="#svg-icon-help"/>
  171. </svg>
  172. </div>
  173. </section>
  174. <section id="actions">
  175. <div>
  176. <button id="save-button" i18n-text="styleSaveLabel"></button>
  177. <button id="beautify" i18n-text="styleBeautify"></button>
  178. <a href="manage.html"><button id="cancel-button" i18n-text="styleCancelEditLabel"></button></a>
  179. </div>
  180. <div id="mozilla-format-container">
  181. <h2 id="mozilla-format-heading" i18n-text="styleMozillaFormatHeading"><svg id="to-mozilla-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2>
  182. <button id="from-mozilla" i18n-text="importLabel"></button>
  183. <button id="to-mozilla" i18n-text="exportLabel"></button>
  184. </div>
  185. </section>
  186. <details id="options" data-pref="editor.options.expanded">
  187. <summary><h2 id="options-heading" i18n-text="optionsHeading"></h2></summary>
  188. <div class="option">
  189. <label id="lineWrapping-label" i18n-text="cm_lineWrapping">
  190. <input id="editor.lineWrapping" type="checkbox">
  191. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  192. </label>
  193. </div>
  194. <div class="option">
  195. <label id="smartIndent-label" i18n-text="cm_smartIndent">
  196. <input id="editor.smartIndent" type="checkbox">
  197. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  198. </label>
  199. </div>
  200. <div class="option">
  201. <label id="indentWithTabs-label" i18n-text="cm_indentWithTabs">
  202. <input id="editor.indentWithTabs" type="checkbox">
  203. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  204. </label>
  205. </div>
  206. <div class="option">
  207. <label i18n-text="cm_autoCloseBrackets" i18n-title="cm_autoCloseBracketsTooltip">
  208. <input id="editor.autoCloseBrackets" type="checkbox">
  209. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  210. </label>
  211. </div>
  212. <div class="option">
  213. <label i18n-text="cm_autocompleteOnTyping">
  214. <input id="editor.autocompleteOnTyping" type="checkbox">
  215. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  216. </label>
  217. </div>
  218. <div class="option">
  219. <label i18n-text="cm_colorpicker">
  220. <input id="editor.colorpicker" type="checkbox">
  221. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  222. </label>
  223. <span class="svg-inline-wrapper" i18n-title="shortcutsNote">
  224. <svg id="colorpicker-settings" class="svg-icon settings">
  225. <use xlink:href="#svg-icon-settings"/>
  226. </svg>
  227. </span>
  228. </div>
  229. <div class="option usercss-only">
  230. <label i18n-text="appliesLineWidgetLabel" i18n-title="appliesLineWidgetWarning">
  231. <input id="editor.appliesToLineWidget" type="checkbox">
  232. <svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
  233. </label>
  234. </div>
  235. <div class="option aligned">
  236. <label id="tabSize-label" for="editor.tabSize" i18n-text="cm_tabSize"></label>
  237. <input id="editor.tabSize" type="number" min="0">
  238. </div>
  239. <div class="option aligned">
  240. <label id="keyMap-label" for="editor.keyMap" i18n-text="cm_keyMap"></label>
  241. <div class="select-resizer">
  242. <select id="editor.keyMap"></select>
  243. <svg class="svg-icon select-arrow"><use xlink:href="#svg-icon-select-arrow"/></svg>
  244. </div>
  245. <span class="svg-inline-wrapper">
  246. <svg id="keyMap-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg>
  247. </span>
  248. </div>
  249. <div class="option aligned">
  250. <label id="theme-label" for="editor.theme" i18n-text="cm_theme"></label>
  251. <div class="select-resizer">
  252. <select id="editor.theme"></select>
  253. <svg class="svg-icon select-arrow"><use xlink:href="#svg-icon-select-arrow"/></svg>
  254. </div>
  255. </div>
  256. <div class="option aligned">
  257. <label id="highlight-label" for="editor.matchHighlight" i18n-text="cm_matchHighlight"></label>
  258. <div class="select-resizer">
  259. <select id="editor.matchHighlight">
  260. <option i18n-text="cm_matchHighlightToken" value="token">
  261. <option i18n-text="cm_matchHighlightSelection" value="selection">
  262. <option i18n-text="genericDisabledLabel" value="">
  263. </select>
  264. <svg class="svg-icon select-arrow"><use xlink:href="#svg-icon-select-arrow"/></svg>
  265. </div>
  266. </div>
  267. <div class="option aligned">
  268. <label id="linter-label" for="editor.linter" i18n-text="cm_linter"></label>
  269. <div class="select-resizer">
  270. <select id="editor.linter">
  271. <option value="csslint" selected>CSSLint</option>
  272. <option value="stylelint">Stylelint</option>
  273. <option value="" i18n-text="genericDisabledLabel"></option>
  274. </select>
  275. <svg class="svg-icon select-arrow"><use xlink:href="#svg-icon-select-arrow"/></svg>
  276. </div>
  277. <span class="svg-inline-wrapper" i18n-title="linterConfigTooltip">
  278. <svg id="linter-settings" class="svg-icon settings">
  279. <use xlink:href="#svg-icon-settings"/>
  280. </svg>
  281. </span>
  282. </div>
  283. </details>
  284. <details id="lint" class="hidden" data-pref="editor.lint.expanded">
  285. <summary>
  286. <h2 i18n-text="linterIssues">: <span id="issue-count"></span><!-- EAT SPACE
  287. --><svg id="lint-help" class="svg-icon info intercepts-click">
  288. <use xlink:href="#svg-icon-help"/>
  289. </svg>
  290. </h2>
  291. </summary>
  292. <div></div>
  293. </details>
  294. <div id="footer" class="hidden">
  295. <a href="https://github.com/openstyles/stylus/wiki/Usercss"
  296. i18n-text="externalUsercssDocument"
  297. target="_blank"></a>
  298. </div>
  299. </div>
  300. <section id="sections">
  301. <h2><span id="sections-heading" i18n-text="styleSectionsTitle"></span><svg id="sections-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2>
  302. </section>
  303. <div id="help-popup">
  304. <div class="title"></div><svg id="sections-help" class="svg-icon dismiss"><use xlink:href="#svg-icon-close"/></svg>
  305. <div class="contents"></div>
  306. </div>
  307. <svg xmlns="http://www.w3.org/2000/svg" style="display: none">
  308. <symbol id="svg-icon-external-link" viewBox="0 0 8 8">
  309. <path d="M0 0v8h8v-2h-1v1h-6v-6h1v-1h-2zm4 0l1.5 1.5-2.5 2.5 1 1 2.5-2.5 1.5 1.5v-4h-4z"></path>
  310. </symbol>
  311. <symbol id="svg-icon-help" viewBox="0 0 14 16" i18n-alt="helpAlt">
  312. <path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path>
  313. </symbol>
  314. <symbol id="svg-icon-close" viewBox="0 0 12 16">
  315. <path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path>
  316. </symbol>
  317. <symbol id="svg-icon-settings" viewBox="0 0 16 16">
  318. <path d="M8,0C7.6,0,7.3,0,6.9,0.1v2.2C6.1,2.5,5.4,2.8,4.8,3.2L3.2,1.6c-0.6,0.4-1.1,1-1.6,1.6l1.6,1.6C2.8,5.4,2.5,6.1,2.3,6.9H0.1C0,7.3,0,7.6,0,8c0,0.4,0,0.7,0.1,1.1h2.2c0.1,0.8,0.4,1.5,0.9,2.1l-1.6,1.6c0.4,0.6,1,1.1,1.6,1.6l1.6-1.6c0.6,0.4,1.4,0.7,2.1,0.9v2.2C7.3,16,7.6,16,8,16c0.4,0,0.7,0,1.1-0.1v-2.2c0.8-0.1,1.5-0.4,2.1-0.9l1.6,1.6c0.6-0.4,1.1-1,1.6-1.6l-1.6-1.6c0.4-0.6,0.7-1.4,0.9-2.1h2.2C16,8.7,16,8.4,16,8c0-0.4,0-0.7-0.1-1.1h-2.2c-0.1-0.8-0.4-1.5-0.9-2.1l1.6-1.6c-0.4-0.6-1-1.1-1.6-1.6l-1.6,1.6c-0.6-0.4-1.4-0.7-2.1-0.9V0.1C8.7,0,8.4,0,8,0z M8,4.3c2.1,0,3.7,1.7,3.7,3.7c0,0,0,0,0,0c0,2.1-1.7,3.7-3.7,3.7c0,0,0,0,0,0c-2.1,0-3.7-1.7-3.7-3.7c0,0,0,0,0,0C4.3,5.9,5.9,4.3,8,4.3C8,4.3,8,4.3,8,4.3z"/>
  319. </symbol>
  320. <symbol id="svg-icon-select-arrow" viewBox="0 0 1792 1792">
  321. <path fill-rule="evenodd" d="M1408 704q0 26-19 45l-448 448q-19 19-45 19t-45-19l-448-448q-19-19-19-45t19-45 45-19h896q26 0 45 19t19 45z"/>
  322. </symbol>
  323. <symbol id="svg-icon-checked" viewBox="0 0 1000 1000">
  324. <path fill-rule="evenodd" d="M983.2,184.3L853,69.8c-4-3.5-9.3-5.3-14.5-5c-5.3,0.4-10.3,2.8-13.8,6.8L352.3,609.2L184.4,386.9c-3.2-4.2-8-7-13.2-7.8c-5.3-0.8-10.6,0.6-14.9,3.9L18,487.5c-8.8,6.7-10.6,19.3-3.9,28.1L325,927.2c3.6,4.8,9.3,7.7,15.3,8c0.2,0,0.5,0,0.7,0c5.8,0,11.3-2.5,15.1-6.8L985,212.6C992.3,204.3,991.5,191.6,983.2,184.3z"/>
  325. </symbol>
  326. </svg>
  327. </body>
  328. </html>