SCSystemBrowser.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>SystemBrowser &mdash; SmallClasses.js</title>
  6. <script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
  7. <script src="ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
  8. <script type="text/javascript">
  9. var SC = window.opener.SC;
  10. window.ace = ace;
  11. var onLoad = function(evt){
  12. window.editorSharedPropertyValidator = ace.edit("sharedPropertyValidatorEditor");
  13. window.editorSharedPropertyTransformer = ace.edit("sharedPropertyTransformerEditor");
  14. window.editorPropertyValidator = ace.edit("propertyValidatorEditor");
  15. window.editorPropertyTransformer = ace.edit("propertyTransformerEditor");
  16. window.editorMethodCode = ace.edit("methodCodeEditor");
  17. allEditors = [
  18. editorSharedPropertyValidator,
  19. editorSharedPropertyTransformer,
  20. editorPropertyValidator,
  21. editorPropertyTransformer,
  22. editorMethodCode
  23. ];
  24. for(var i = 0; i < allEditors.length; i++){
  25. allEditors[i].setTheme("ace/theme/monokai");
  26. allEditors[i].getSession().setMode("ace/mode/javascript");
  27. allEditors[i].setFontSize(16)
  28. allEditors[i].setOptions({ maxLines: Infinity,
  29. showPrintMargin: false,
  30. highlightActiveLine: false,
  31. enableBasicAutocompletion: true,
  32. });
  33. }
  34. onResize();
  35. SC.init('SCSystemBrowser', { browserWindow: window });
  36. };
  37. var onResize = function(evt){
  38. window.document.getElementById('packageList').style.height = (window.innerHeight-100) + 'px';
  39. window.document.getElementById('classControls').style.width = (window.innerWidth-200) + 'px';
  40. window.document.getElementById('classTraitsInput').style.width = (window.innerWidth-300) + 'px';
  41. window.document.getElementById('classMixinsInput').style.width = (window.innerWidth-300) + 'px';
  42. window.document.getElementById('classSharedPropertiesList').style.width = ((window.innerWidth-200)/3) + 'px';
  43. window.document.getElementById('classPropertiesList').style.width = ((window.innerWidth-200)/3) + 'px';
  44. window.document.getElementById('classMethodsList').style.width = ((window.innerWidth-200)/3) + 'px';
  45. window.document.getElementById('classPropertiesList').style.left = ((window.innerWidth-200)/3) + 'px';
  46. window.document.getElementById('classMethodsList').style.left = ((window.innerWidth-200)/3*2) + 'px';
  47. for(var divsToFillWidth = [
  48. 'classCommentEditor',
  49. 'sharedPropertyCommentEditor',
  50. 'sharedPropertyInitValueEditor',
  51. 'sharedPropertyValidatorEditor',
  52. 'sharedPropertyTransformerEditor',
  53. 'propertyCommentEditor',
  54. 'propertyValidatorEditor',
  55. 'propertyTransformerEditor',
  56. 'methodCommentEditor',
  57. 'methodCodeEditor'
  58. ],
  59. i = 0; i < divsToFillWidth.length; i++){
  60. window.document.getElementById(divsToFillWidth[i]).style.width = (window.innerWidth-240) + 'px';
  61. }
  62. for(var editorPanes = window.document.getElementsByClassName('editorPane'),
  63. i = 0; i < editorPanes.length; i++){
  64. //editorPanes[i].style.width = (window.innerWidth-200) + 'px';
  65. //editorPanes[i].style.height = (window.innerHeight-330) + 'px';
  66. editorSharedPropertyValidator.resize();
  67. editorSharedPropertyTransformer.resize();
  68. editorPropertyValidator.resize();
  69. editorPropertyTransformer.resize();
  70. editorMethodCode.resize();
  71. }
  72. };
  73. window.addEventListener('DOMContentLoaded', onLoad);
  74. window.addEventListener('resize', onResize);
  75. </script>
  76. <style>
  77. .ace-monokai .ace_gutter {
  78. background: #333 !important;
  79. color: #8F908A !important;
  80. }
  81. .ace-monokai .ace_marker-layer .ace_selection {
  82. background: #6F70AA !important;
  83. }
  84. .ace_editor, .ace_editor * {
  85. font-family: Consolas, "Lucida Console", Monaco, monospace !important;
  86. font-size: 16px !important;
  87. font-weight: 400 !important;
  88. letter-spacing: 0 !important;
  89. }
  90. .ace_autocomplete {
  91. background: #555 !important;
  92. color: #fff !important;
  93. box-shadow: 2px 3px 5px rgba(255,255,255,.2) !important;
  94. }
  95. .ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {
  96. background-color: #6F70AA !important;
  97. }
  98. ::selection {
  99. background: #6F70AA;
  100. }
  101. * {
  102. font-family: Consolas, "Lucida Console", Monaco, monospace;
  103. font-size: 16px;
  104. font-weight: 400;
  105. letter-spacing: 0;
  106. }
  107. body {
  108. background-color: #333;
  109. color: #FFF;
  110. padding: 0px;
  111. margin: 0px;
  112. width: 100%;
  113. height: 100%;
  114. display: box;
  115. }
  116. input {
  117. background-color: #444;
  118. color: #FFF;
  119. border: none;
  120. padding: 3px;
  121. }
  122. select {
  123. background-color: #444;
  124. color: #FFF;
  125. border: none;
  126. padding: 3px;
  127. padding-top: 6px;
  128. }
  129. ::-webkit-scrollbar {
  130. width: 16px;
  131. height: 16px;
  132. }
  133. ::-webkit-scrollbar-track {
  134. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
  135. border-radius: 10px;
  136. }
  137. ::-webkit-scrollbar-thumb {
  138. border-radius: 10px;
  139. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
  140. }
  141. .widgetContainer {
  142. position: absolute;
  143. display: box;
  144. margin: 0px;
  145. padding: 0px;
  146. }
  147. #packageControls {
  148. top: 0px;
  149. left: 0px;
  150. width: 200px;
  151. height: 100%;
  152. }
  153. #packageList {
  154. top: 0px;
  155. width: 200px;
  156. height: 440px;
  157. }
  158. #packageList > * {
  159. width: 100%;
  160. height: 100%;
  161. }
  162. #packageAction {
  163. bottom: 0px;
  164. width:200px;
  165. height:100px;
  166. }
  167. #classControls {
  168. top: 0px;
  169. left: 200px;
  170. width: 590px;
  171. height: 100%;
  172. overflow-x: hidden;
  173. }
  174. #classTraits {
  175. top: 0px;
  176. height: 30px;
  177. }
  178. #classMixins {
  179. top: 30px;
  180. height: 30px;
  181. }
  182. #classTraitsLabel, #classMixinsLabel {
  183. position: absolute;
  184. top: 10px;
  185. left: 6px;
  186. width: 70px;
  187. color: #707070;
  188. }
  189. #classTraitsInput, #classMixinsInput {
  190. position: absolute;
  191. top: 3px;
  192. left: 80px;
  193. width: 500px;
  194. }
  195. #classMembersBrowser {
  196. top: 80px;
  197. left: 0px;
  198. width: 100%;
  199. height:230px;
  200. }
  201. #classSharedPropertiesList, #classPropertiesList, #classMethodList {
  202. height: 100%;
  203. width: 200px;
  204. }
  205. #classSharedPropertiesSelect, #classPropertiesSelect, #classMethodsSelect {
  206. width: 100%;
  207. height: 180px;
  208. }
  209. .classBrowserLabel {
  210. margin-top:6px;
  211. padding-left: 6px;
  212. color: #707070;
  213. }
  214. .classBrowserIndent {
  215. margin-left: 42px;
  216. }
  217. #classSharedPropertiesList { left:0px; }
  218. #classPropertiesList { left:200px; }
  219. #classMethodList { left:400px; }
  220. .classMembersToolbar{
  221. width:100%;
  222. display: block;
  223. }
  224. #classMemberEditor {
  225. position: absolute;
  226. top: 300px;
  227. left: 0px;
  228. width: 600px;
  229. }
  230. .editorPane {
  231. position: absolute;
  232. top: 0px;
  233. left: 0px;
  234. width: 600px;
  235. height: 296px;
  236. }
  237. #classEditor, #sharedPropertyEditor, #propertyEditor, #methodEditor {
  238. visibility: hidden;
  239. position: absolute;
  240. top: 0px;
  241. left: 0px;
  242. width: 100%;
  243. height: 170px;
  244. }
  245. #classCommentEditor,
  246. #sharedPropertyCommentEditor,
  247. #sharedPropertyInitValueEditor,
  248. #sharedPropertyValidatorEditor,
  249. #sharedPropertyTransformerEditor,
  250. #propertyCommentEditor,
  251. #propertyValidatorEditor,
  252. #propertyTransformerEditor,
  253. #methodCommentEditor,
  254. #methodCodeEditor {
  255. display: block;
  256. width: 600px;
  257. min-height: 80px;
  258. background-color: #444;
  259. color: #FFF;
  260. margin-bottom: 10px;
  261. padding: 6px
  262. }
  263. </style>
  264. </head>
  265. <body>
  266. <div id="packageControls" class="widgetContainer">
  267. <div id="packageList" class="widgetContainer">
  268. <select id="packageListSelect">
  269. </select>
  270. </div>
  271. <div id="packageAction" class="widgetContainer">
  272. <p> &#8593; Class managment &#8593;<br>
  273. &mdash;New/Clone/Delete&mdash;<br>
  274. &mdash;File-in/File-out&mdash;
  275. </p>
  276. </div>
  277. </div>
  278. <div id="classControls" class="widgetContainer">
  279. <div id="classTraits" class="widgetContainer">
  280. <div id="classTraitsLabel">Traits:</div>
  281. <input type="text" id="classTraitsInput">
  282. </div>
  283. <div id="classMixins" class="widgetContainer">
  284. <div id="classMixinsLabel">Mixins:</div>
  285. <input type="text" id="classMixinsInput">
  286. </div>
  287. <div id="classMembersBrowser" class="widgetContainer">
  288. <div id="classSharedPropertiesList" class="widgetContainer">
  289. <div class="classBrowserLabel">Shared Properties</div>
  290. <select id="classSharedPropertiesSelect" size="3">
  291. </select>
  292. <div class="classMembersToolbar">
  293. <!--button id="classSharedPropertiesPlus">+</button>
  294. <button id="classSharedPropertiesMinus">-</button-->
  295. </div>
  296. </div>
  297. <div id="classPropertiesList" class="widgetContainer">
  298. <div class="classBrowserLabel">Properties</div>
  299. <select id="classPropertiesSelect" size="3">
  300. </select>
  301. <div class="classMembersToolbar">
  302. <!--button id="classPropertiesPlus">+</button>
  303. <button id="classPropertiesMinus">-</button-->
  304. </div>
  305. </div>
  306. <div id="classMethodsList" class="widgetContainer">
  307. <div class="classBrowserLabel">Methods</div>
  308. <select id="classMethodsSelect" size="3">
  309. </select>
  310. <div class="classMembersToolbar">
  311. <!--button id="classMethodsPlus">+</button>
  312. <button id="classMethodsMinus">-</button-->
  313. </div>
  314. </div>
  315. </div>
  316. <div id="classMemberEditor" class="widgetContainer">
  317. <div id="classEditor" class="editorPane">
  318. <div class="classBrowserLabel">Class Comment:</div>
  319. <div id="classCommentEditor"></div>
  320. </div>
  321. <div id="sharedPropertyEditor" class="editorPane">
  322. <div class="classBrowserLabel classBrowserIndent">Comment:</div>
  323. <div id="sharedPropertyCommentEditor" class="classBrowserIndent"></div>
  324. <div class="classBrowserLabel classBrowserIndent">Initial Value:</div>
  325. <div id="sharedPropertyInitValueEditor" class="classBrowserIndent"></div>
  326. <div class="classBrowserLabel classBrowserIndent">Validator Function:</div>
  327. <div id="sharedPropertyValidatorEditor"></div>
  328. <div class="classBrowserLabel classBrowserIndent">Transformer Function:</div>
  329. <div id="sharedPropertyTransformerEditor"></div>
  330. </div>
  331. <div id="propertyEditor" class="editorPane">
  332. <div class="classBrowserLabel classBrowserIndent">Comment:</div>
  333. <div id="propertyCommentEditor" class="classBrowserIndent"></div>
  334. <div class="classBrowserLabel classBrowserIndent">Validator Function:</div>
  335. <div id="propertyValidatorEditor"></div>
  336. <div class="classBrowserLabel classBrowserIndent">Transformer Function:</div>
  337. <div id="propertyTransformerEditor"></div>
  338. </div>
  339. <div id="methodEditor" class="editorPane">
  340. <div class="classBrowserLabel classBrowserIndent">Comment:</div>
  341. <div id="methodCommentEditor" class="classBrowserIndent"></div>
  342. <div class="classBrowserLabel classBrowserIndent">Method Code:</div>
  343. <div id="methodCodeEditor"></div>
  344. </div>
  345. </div>
  346. </div>
  347. </body>
  348. </html>