Advertisement
stuppid_bot

Sort Strings eg python imports

Dec 21st, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.47 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title>Sort Strings</title>
  6.     <link rel="stylesheet" type="text/css" href="https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css">
  7.     <style type="text/css">
  8.       body {
  9.         font: 13px/1.2em Arial, sans-serif;
  10.       }
  11.  
  12.       .wrapper {
  13.         margin: auto;
  14.         width: 960px;
  15.       }
  16.  
  17.       .content {
  18.         margin: 10px 20px;
  19.       }
  20.  
  21.       .content textarea {
  22.         /* line-height * 5 */
  23.         height: 5.5em;
  24.         line-height: 1.1em;
  25.         width: 100%;
  26.       }
  27.     </style>
  28.     <script type="text/javascript">
  29.       'use strict';
  30.       let $ = q => document.querySelector(q);
  31.  
  32.       window.addEventListener('load', () => {
  33.         $('#sort').onclick = (e) => {
  34.           e.preventDefault();
  35.           let input = $('#input').value;
  36.           input = input.split('\n');
  37.           input.sort();
  38.           $('#output').value = input.join('\n');
  39.         };
  40.       });
  41.     </script>
  42.   </head>
  43.   <body>
  44.     <div class="wrapper">
  45.       <div class="content">
  46.         <h2>Sort Strings</h2>
  47.         <form>
  48.           <div>
  49.             <textarea id="input" placeholder="Input"></textarea>
  50.           </div>
  51.           <div>
  52.             <textarea id="output" placeholder="Output"></textarea>
  53.           </div>
  54.           <div>
  55.             <button id="sort">Sort</button>
  56.           </div>
  57.         </form>
  58.       </div>
  59.     </div>
  60.   </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement