styleeditor.xul 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?xml version="1.0"?>
  2. <!-- This Source Code Form is subject to the terms of the Mozilla Public
  3. - License, v. 2.0. If a copy of the MPL was not distributed with this
  4. - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  5. <!DOCTYPE window [
  6. <!ENTITY % styleEditorDTD SYSTEM "chrome://devtools/locale/styleeditor.dtd" >
  7. %styleEditorDTD;
  8. <!ENTITY % editMenuStrings SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
  9. %editMenuStrings;
  10. <!ENTITY % sourceEditorStrings SYSTEM "chrome://devtools/locale/sourceeditor.dtd">
  11. %sourceEditorStrings;
  12. <!ENTITY % csscoverageDTD SYSTEM "chrome://devtools-shared/locale/csscoverage.dtd">
  13. %csscoverageDTD;
  14. ]>
  15. <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
  16. <?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
  17. <?xml-stylesheet href="chrome://devtools/content/shared/splitview.css" type="text/css"?>
  18. <?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
  19. <?xml-stylesheet href="chrome://devtools/skin/splitview.css" type="text/css"?>
  20. <?xml-stylesheet href="chrome://devtools/skin/styleeditor.css" type="text/css"?>
  21. <?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
  22. <xul:window xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  23. xmlns="http://www.w3.org/1999/xhtml"
  24. id="style-editor-chrome-window">
  25. <script type="application/javascript;version=1.8"
  26. src="chrome://devtools/content/shared/theme-switching.js"/>
  27. <xul:script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
  28. <xul:script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
  29. <xul:script type="application/javascript">
  30. function goUpdateSourceEditorMenuItems() {
  31. goUpdateGlobalEditMenuItems();
  32. ['cmd_undo', 'cmd_redo', 'cmd_cut', 'cmd_paste',
  33. 'cmd_delete', 'cmd_find', 'cmd_findAgain'].forEach(goUpdateCommand);
  34. }
  35. </xul:script>
  36. <xul:popupset id="style-editor-popups">
  37. <xul:menupopup id="sourceEditorContextMenu"
  38. onpopupshowing="goUpdateSourceEditorMenuItems()">
  39. <xul:menuitem id="cMenu_undo"/>
  40. <xul:menuseparator/>
  41. <xul:menuitem id="cMenu_cut"/>
  42. <xul:menuitem id="cMenu_copy"/>
  43. <xul:menuitem id="cMenu_paste"/>
  44. <xul:menuitem id="cMenu_delete"/>
  45. <xul:menuseparator/>
  46. <xul:menuitem id="cMenu_selectAll"/>
  47. <xul:menuseparator/>
  48. <xul:menuitem id="se-menu-find"
  49. label="&findCmd.label;" accesskey="&findCmd.accesskey;" command="cmd_find"/>
  50. <xul:menuitem id="cMenu_findAgain"/>
  51. <xul:menuseparator/>
  52. <xul:menuitem id="se-menu-gotoLine"
  53. label="&gotoLineCmd.label;"
  54. accesskey="&gotoLineCmd.accesskey;"
  55. key="key_gotoLine"
  56. command="cmd_gotoLine"/>
  57. </xul:menupopup>
  58. <xul:menupopup id="sidebar-context">
  59. <xul:menuitem id="context-openlinknewtab"
  60. label="&openLinkNewTab.label;"/>
  61. </xul:menupopup>
  62. <xul:menupopup id="style-editor-options-popup"
  63. position="before_start">
  64. <xul:menuitem id="options-origsources"
  65. type="checkbox"
  66. label="&showOriginalSources.label;"
  67. accesskey="&showOriginalSources.accesskey;"/>
  68. <xul:menuitem id="options-show-media"
  69. type="checkbox"
  70. label="&showMediaSidebar.label;"
  71. accesskey="&showMediaSidebar.accesskey;"/>
  72. </xul:menupopup>
  73. </xul:popupset>
  74. <xul:commandset id="editMenuCommands"/>
  75. <xul:commandset id="sourceEditorCommands">
  76. <xul:command id="cmd_gotoLine" oncommand="goDoCommand('cmd_gotoLine')"/>
  77. <xul:command id="cmd_find" oncommand="goDoCommand('cmd_find')"/>
  78. <xul:command id="cmd_findAgain" oncommand="goDoCommand('cmd_findAgain')"/>
  79. </xul:commandset>
  80. <xul:keyset id="sourceEditorKeys"/>
  81. <xul:stack id="style-editor-chrome" class="loading theme-body">
  82. <xul:box class="splitview-root devtools-responsive-container" context="sidebar-context">
  83. <xul:box class="splitview-controller">
  84. <xul:box class="splitview-main">
  85. <xul:toolbar class="devtools-toolbar">
  86. <xul:hbox class="devtools-toolbarbutton-group">
  87. <xul:toolbarbutton class="style-editor-newButton devtools-toolbarbutton"
  88. accesskey="&newButton.accesskey;"
  89. tooltiptext="&newButton.tooltip;"/>
  90. <xul:toolbarbutton class="style-editor-importButton devtools-toolbarbutton"
  91. accesskey="&importButton.accesskey;"
  92. tooltiptext="&importButton.tooltip;"/>
  93. </xul:hbox>
  94. <xul:spacer/>
  95. <xul:toolbarbutton id="style-editor-options"
  96. class="devtools-toolbarbutton devtools-option-toolbarbutton"
  97. tooltiptext="&optionsButton.tooltip;"
  98. popup="style-editor-options-popup"/>
  99. </xul:toolbar>
  100. </xul:box>
  101. <xul:box id="splitview-resizer-target" class="theme-sidebar splitview-nav-container"
  102. persist="height">
  103. <div class="devtools-throbber"></div>
  104. <ol class="splitview-nav" tabindex="0"></ol>
  105. <div class="splitview-nav placeholder empty">
  106. <p><strong>&noStyleSheet.label;</strong></p>
  107. <p>&noStyleSheet-tip-start.label;
  108. <a href="#"
  109. class="style-editor-newButton">&noStyleSheet-tip-action.label;</a>
  110. &noStyleSheet-tip-end.label;</p>
  111. </div>
  112. </xul:box> <!-- .splitview-nav-container -->
  113. </xul:box> <!-- .splitview-controller -->
  114. <xul:splitter class="devtools-side-splitter devtools-invisible-splitter"/>
  115. <xul:box class="splitview-side-details devtools-main-content"/>
  116. <div id="splitview-templates" hidden="true">
  117. <li id="splitview-tpl-summary-stylesheet" tabindex="0">
  118. <xul:label class="stylesheet-enabled" tabindex="0"
  119. tooltiptext="&visibilityToggle.tooltip;"
  120. accesskey="&saveButton.accesskey;"></xul:label>
  121. <hgroup class="stylesheet-info">
  122. <h1><a class="stylesheet-name" tabindex="0"><xul:label crop="center"/></a></h1>
  123. <div class="stylesheet-more">
  124. <h3 class="stylesheet-title"></h3>
  125. <h3 class="stylesheet-linked-file"></h3>
  126. <h3 class="stylesheet-rule-count"></h3>
  127. <xul:spacer/>
  128. <h3><xul:label class="stylesheet-saveButton"
  129. tooltiptext="&saveButton.tooltip;"
  130. accesskey="&saveButton.accesskey;">&saveButton.label;</xul:label></h3>
  131. </div>
  132. </hgroup>
  133. </li>
  134. <xul:box id="splitview-tpl-details-stylesheet" class="splitview-details">
  135. <xul:hbox class="stylesheet-details-container">
  136. <xul:box class="stylesheet-editor-input textbox"
  137. data-placeholder="&editorTextbox.placeholder;"/>
  138. <xul:splitter class="devtools-side-splitter"/>
  139. <xul:vbox class="stylesheet-sidebar theme-sidebar" hidden="true">
  140. <xul:toolbar class="devtools-toolbar">
  141. &mediaRules.label;
  142. </xul:toolbar>
  143. <xul:vbox class="stylesheet-media-container" flex="1">
  144. <div class="stylesheet-media-list" />
  145. </xul:vbox>
  146. </xul:vbox>
  147. </xul:hbox>
  148. </xul:box>
  149. </div> <!-- #splitview-templates -->
  150. </xul:box> <!-- .splitview-root -->
  151. <xul:box class="csscoverage-template" hidden="true">
  152. <xul:toolbar class="devtools-toolbar csscoverage-toolbar">
  153. <xul:button class="devtools-toolbarbutton csscoverage-toolbarbutton"
  154. label="&csscoverage.backButton;"
  155. onclick="${onback}"/>
  156. </xul:toolbar>
  157. <!-- The data for this comes from CSSUsageActor.createPageReport -->
  158. <div class="csscoverage-report-container">
  159. <div class="csscoverage-report-content">
  160. <div class="csscoverage-report-summary">
  161. <div class="csscoverage-report-chart"/>
  162. </div>
  163. <div class="csscoverage-report-unused">
  164. <h2>&csscoverage.unused;</h2>
  165. <p>&csscoverage.noMatches;</p>
  166. <div foreach="page in ${unused}">
  167. <h3>${page.url}</h3>
  168. <code foreach="rule in ${page.rules}"
  169. href="${rule.url}"
  170. class="csscoverage-list">${rule.selectorText}</code>
  171. </div>
  172. </div>
  173. <div class="csscoverage-report-optimize">
  174. <h2>&csscoverage.optimize.header;</h2>
  175. <p>
  176. &csscoverage.optimize.body1;
  177. <code>&lt;link ...></code>
  178. &csscoverage.optimize.body2;
  179. <code>&lt;style>...</code>
  180. &csscoverage.optimize.body3;
  181. </p>
  182. <div if="${preload.length == 0}">&csscoverage.optimize.bodyX;</div>
  183. <div if="${preload.length > 0}">
  184. <div foreach="page in ${preload}">
  185. <h3>${page.url}</h3>
  186. <textarea>&lt;style>
  187. <loop foreach="rule in ${page.rules}"
  188. onclick="${rule.onclick}">${rule.formattedCssText}</loop>&lt;/style></textarea>
  189. </div>
  190. </div>
  191. <p>
  192. &csscoverage.footer1;
  193. <a target="_blank" href="&csscoverage.footer2a;">&csscoverage.footer3;</a>
  194. &csscoverage.footer4;
  195. </p>
  196. </div>
  197. <p>&#160;</p>
  198. </div>
  199. </div>
  200. </xul:box>
  201. <xul:box class="csscoverage-report" hidden="true">
  202. </xul:box>
  203. </xul:stack>
  204. </xul:window>