It's not clear to me how the code here is organized -- the only
content I see being delivered which addresses "readonly" has to do
with file names.

Looking at plausible css selectors for either a background-color or a
reference point for manipulating either an inline style or a class
which carries the background color, I see:

#jresizeb
.CodeMirror
.CodeMirror-scroll
.CodeMirror-lines

And currently nothing seems to carry any background color, so there
should be no obstacles to setting it wherever you feel is appropriate.

The various CodeMirror classes have slightly different geometries
(I've listed them from largest to smallest), though for background
color I do not see any difference between .CodeMirror and
.CodeMirror-scroll

I also saw a .cm-s-default at the same level as .CodeMirror-scroll but
.cm-s-default is probably a conditional class -- something that's only
used occasionally.

I noticed that there's a javascript object on the page that's named cm
which has a setLineClass method, but
http://stackoverflow.com/questions/8252185/syntax-higlight-in-codemirror
suggests that that's for manipulating individual lines.  There was
also a setOption but I did not see anything that suggests it was
designed for this kind of thing.

As an aside, I've been using jQuery a lot for client side manipulation
of the document.  As far as I know, jQuery has nothing to do with the
j programming language, but ironically it does bring javascript
slightly closer to a "j-ish" computational style.  In other words, it
includes a variety of concessions towards data-driven code.  (I've
also been using require, underscore and backbone -- all various
javascript utilities with various advantages and constraints... In
some ways these kinds of things seem like overkill for something like
jhs, but when I look at the complexity of the jhs code I'm not so
sure.)  Anyways, with jquery you could do something like this:

$('.CodeMirror').css('background-color', 'lightblue')

or

$('.CodeMirror').css('background-color', 'white')

(For example...)

FYI,

-- 
Raul

On Thu, Oct 4, 2012 at 8:54 AM, Eric Iverson <[email protected]> wrote:
> I couldn't figure out how to change the codemirrir background color to
> indicate readonly. I'm sure it can be done and someday this change
> will be made. In the meantime readonly state is indicated by the word
> readonly to the left of the file name just above the edit area. Not as
> good as a different background color but I didn't want to delay
> getting codemirror available.
>
> On Wed, Oct 3, 2012 at 5:10 AM, Linda Alvord <[email protected]> wrote:
>> In J7 on Chrome using Vista, now that the code has numbers and different
>> colors within the code, there is no longer a blue background when readonly
>> is active.  It is no longer easy to tell when editing is permitted.
>>
>> I'm not sure this can be adjusted, but it would be nice to restore it.
>>
>>
>>
>> Linda
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to