Jump to content

Robert Moskowitz

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Robert Moskowitz

  1. I was a LOOONG time away from html. Like I did html 1.0 and then nothing until recently so am using the information here and elsewhere to learn. I tried putting the stylesheet into the html file: <head> <title>CentOS 7 for an Odroid HC1</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="Author" content="Robert Moskowitz"> <meta name="generator" content="Geany 1.33" /> <meta name="description" content="Installing CentOS 7 server on an Odroid HC1"> <meta name="keywords" content="CentOS 7, CentOS 7 server, ARM, armv7, Odroid, HardKernel"> <style> body {"font-size:16px;"} textarea {"border:1px solid black;resize:none;font-size:inherit;padding-top:1em; margin-left:3em;overflow-y:hidden;overflow-x:auto;"} </style> </head> then I set up a texteara: <textarea id="box1" readonly="readonly" onclick="this.select()" style="width:50em;height:8em"> mkdir hardkernel ; cd hardkernel wget https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/sd_fusing.sh \ https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/bl1.bin.hardkernel \ https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/bl2.bin.hardkernel.720k_uboot \ https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/tzsw.bin.hardkernel </textarea> And this text area has the style information inline, but not the internal style information. I am using https://www.w3schools.com/css/css_syntax.asp as my guide... What am I missing? thanks
  2. I have a howto: http://www.htt-consult.com/CentOS7-armv7.html That has over 30 textareas with commands. I have set up these textarea so if you click on them, the whole textarea content is selected so it is easy to copy to the clipboard. The style of these textarea are practically the same; just variations in size and if scroll bars are needed. A common content is: <textarea id="box1" readonly="readonly" onclick="this.select()" style="border:1px solid black;resize:none;font-size:inherit;padding-top:1em; margin-left:3em;width:18em;height:2em;overflow-y:hidden;overflow-x:auto; font-family: verdana,tahoma,'Bitstream Vera Sans','DejaVu Sans',arial,helvetica,sans-serif;"> I was wondering if there is a way to set much of this as default so I don't have to have it declared in each textarea tag. thanks
  3. Ah, <body style="font-size:16px;"> Made the difference. thanks
  4. I just tried font-size:inherit; And that did not work. You can see the above textarea in http://www.htt-consult.com/CentOS7-armv7.html thanks
  5. Oh, the 'regular' style I would use is: style="border:1px solid black ;padding-top:1em;padding-bottom:1em; resize:none;margin-left:3em;width:20em;height:1em;overflow-y:hidden;overflow-x:auto;"
  6. I cannot figure out how to get a textarea to have the same font-size as the rest of a document, I have tried a lot of different things with style= following https://www.w3schools.com/cssref/pr_font_font-size.asp But can't figure it out. Even tried without style: <textarea readonly="readonly" onclick="this.select()" > sudo screen /dev/ttyUSB0 115200<br> </textarea> that text is smaller than the rest of the document. So please point me to the magic on setting the font-size right for a textarea.
  7. Did a bunch of trying until I got just the lines in the block into the clipboard. I got rid of the div and span tags and put everything into the pre tag. The following little body works with one caveat that the button does not rest immediately below the boarder of the box (about a 1/2 line gap): <body> text <br><br> <pre id="box11" style="border:1px solid black;margin-left:3em;padding-top:1em; width:25em;height:9em;overflow-y:hidden;overflow-x:auto;font-size: 16px"> bind 'set disable-completion on' cat &lt;&lt;EOF&gt;&gt;/etc/aliases || exit 1 root: $admin_email EOF newaliases bind 'set disable-completion off' </pre> <button style="margin-left:4em" onclick="copyClipboard('box11')">Copy text</button> <br><br> text <script> function copyClipboard(x) { var elm = document.getElementById(x); // for Internet Explorer if(document.body.createTextRange) { var range = document.body.createTextRange(); range.moveToElementText(elm); range.select(); document.execCommand("Copy"); // alert("Copied div content to clipboard"); } else if(window.getSelection) { // other browsers var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(elm); selection.removeAllRanges(); selection.addRange(range); document.execCommand("Copy"); // alert("Copied div content to clipboard"); } } </script> </body>
  8. I have a howto that includes blocks of text that must or at least should be copied exactly to the clipboard, maintaining multiple spaces and tabs. Currently I have things like: <div id="box12" style="border:1px solid black ;padding-top:0em;padding-bottom:1em; margin-left:3em;width:28em;height:10em;overflow-y:hidden;overflow-x:auto;"> <pre><span class="inner-pre" style="font-size: 16px"> bind 'set disable-completion on' cat &lt;&lt;EOF&gt;&gt;/etc/aliases || exit 1 root: $admin_email EOF newaliases bind 'set disable-completion off' </span></pre> </div> Is there a better way to do this? When I use my new copy to clipboard java script, I get 2 blank lines in front and one at the end (at least with Firefox).
  9. With some help on the Fedora users list (asking for an editor that would show the UTF-8 value of that character), I have been told that it IS a space in Firefox and does not exist in Chrome. So can someone help me add trim() to my script? thanks
  10. I am to wed to using a div container for the text, other than I have howtos with dozens of such blocks. See: www.htt-consult.com/arm.html I am updating these pages with better formatting in the div style part. And adding the copy button. If there is some other container that will show nicely, and simply. Can be selected and manually copied to the clipboard, and can have a javascipt button to copy to the clipboard, I am interested. Or just figure this out and get it working...
  11. Now I am not sure it is a space at the beginning of the first line. It shows as a space when I paste into terminal, vim in insert, or mousepad. Nothing shows when I paste into Libreword, but it goes into a boxed set of lines. How can I display what ever that first character is? I have simplified my code by learning how to use the style margin-left: <div id="box1" style="border:1px solid black;margin-left:40px;width:550px; height:90px;overflow-y:hidden;overflow-x:auto;"> sed -i "s|append|& cpuidle.off=1 \<br> console=tty1 console=ttySAC2,115200n8 \<br> rd.driver.pre=ledtrig-heartbeat,xhci-plat-hcd no_bL_switcher|" \<br> /mnt/__boot/extlinux/extlinux.conf<br> </div> <button style="margin-left:40px" onclick="copyClipboard('box1')">Copy text</button>
  12. Ah, and that would trim it for FIrefox and not impact Chrome (if what we are seeing is correct). But I am not an objects person. In that script above, what do I trim()? thanks
  13. I cannot get that howto to work with a div block. Here is the code I have tried: <body> <blockquote> <div id="box1" style="border:1px solid black;width:550px;height:90px;overflow-y:hidden;overflow-x:auto;"> sed -i "s|append|& cpuidle.off=1 \<br> console=tty1 console=ttySAC2,115200n8 \<br> rd.driver.pre=ledtrig-heartbeat,xhci-plat-hcd no_bL_switcher|" \<br> /mnt/__boot/extlinux/extlinux.conf<br> </div> <button onclick="copyClipboard('box1')">Copy text</button> </blockquote> <script> function copyClipboard(x) { var elm = document.getElementById(x); // for Internet Explorer if(document.body.createTextRange) { var range = document.body.createTextRange(); range.moveToElementText(elm); range.select(); document.execCommand("Copy"); // alert("Copied div content to clipboard"); } else if(window.getSelection) { // other browsers var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(elm); selection.removeAllRanges(); selection.addRange(range); document.execCommand("Copy"); // alert("Copied div content to clipboard"); } } </script> </body> A friend tried this in Chrome and reports he did not have a problem with a leading space, so it might bve a Firefox arttifact.
  14. I am trying to add a button to a Div section to copy to the clipboard. I found some javascript at: https://edupala.com/copy-div-content-clipboard/ That works with one caveat. That is there always seems to be a space at the beginning of the content copied to the clipboard (at least with Firefox browser). Can anyone help me get that space out of the copy? I cannot find a copy div to clipboard here on w3schools. This impacts some of my div blocks that have content that is pasted into other commands. thanks
×
×
  • Create New...