Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Protected Text
10-11-2011, 09:17 PM, (This post was last modified: 10-12-2011, 08:41 PM by RobertShiplett.)
Protected Text
I have a standard header for simple text pages that I wish to protect from copy and paste. Most often the issue is copyright outside the USA. A more complex header is needed when styles and macros are required, but ost of these texts ate wrapped in a simple {pre }. Suggestions, anyone? In the absence of additional code, there is no suspend or resume, for example.

{curl 8.0 applet}
{curl-file-attributes character-encoding="utf8"}
|| manifest = "NO-manifest.mcurl",
{compiler-directives careful? = true}
{document-style DefaultDocument}
{set-document-properties background= {Background.from-string "linen"}}

{title heading?=false, BROWSER TITLE }

{let inspect?:bool} || SET THIS FLAG AS NEEDED
set inspect? = true
{if not inspect? then
|| {include "", "" }
{TextFlowBox text-selectable? = inspect?, paragraph-left-indent=8pt,
{on ae:AttachEvent do
{if not inspect? then
set ae.root-frame.context-menu-for-view = null
\u0020 {br}

} || pre
} || para
} || TFB
|| eof text ln nnn ------------------------------------

The forced space at the start of the {pre } ensures that, if the first line of the text is centred, the first line will display as intended. The quirk is apparent at least in Firefox 3 on Ubuntu maverick.

Note on fonts: when using {pre } it will not help to set font properties in the TextFlowBox. The following works:
{pre font-family="serif",font-size=10pt,
or to replace this with
{paragraph text-preserve-whitespace?=false,
and then control font in one place from the TextFlowBox
Robert Shiplett, Curlr
Fredericton NB


Possibly Related Threads...
Thread Author Replies Views Last Post
  Non-selectable characters amidst text RobertShiplett 1 4,996 09-09-2014, 03:16 AM
Last Post: RobertShiplett
  Curl as a markup DSL for Russian Text RobertShiplett 1 6,379 09-24-2012, 01:17 PM
Last Post: alton
  row as text-proc RobertShiplett 0 3,029 08-14-2012, 09:52 PM
Last Post: RobertShiplett
  serialization for selections from a large off-line Japanese text resource RobertShiplett 0 2,907 06-04-2012, 11:20 PM
Last Post: RobertShiplett
  text-selectable? and DefaultDocument RobertShiplett 0 3,021 11-05-2011, 12:08 AM
Last Post: RobertShiplett
  Text Markup RobertShiplett 0 3,424 10-31-2011, 06:07 AM
Last Post: RobertShiplett
Forum Jump:

Users browsing this thread:
1 Guest(s)