RPTools.net

Discussion and Support

Skip to content

It is currently Fri Nov 17, 2017 11:33 pm 






Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Giant
 
Joined: Wed Dec 09, 2009 4:44 pm
Posts: 126
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Sat Jun 19, 2010 5:21 pm 
Nice looking stuff, maybe I'll create some automated macros for my treasure.

_________________
Let's share our creativity: http://cid-be06ec931d4a4fa5.office.live ... e%20Tokens
http://groups.google.com/group/tokensrumble


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Sun Jun 15, 2008 1:40 pm
Posts: 444
Location: Montréal, QC
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Tue Jun 29, 2010 9:57 pm 
Azhrei wrote:
The first element that appears in the chat panel which is NOT valid inside the <head> is probably what triggers the Java code to switch from the head to the body. And once switched, you can't get back. :(

Not from what I can tell, although macro output does get ... altered ... considerably on the way to chat. For example, a macro containing this:
Code:
<link rel="stylesheet" type="text/css" href="styles.css@[R: getMacroLocation()]"> <!-- Custom stylesheet.  "@this" will not work -->

<!-----===== OnCampaignLoad =====----->
<b>HTML START</b>
<p>paragraph <em>of text</em>.</p>

Produces chat output like this in html (even if it is the first thing that runs):
Code:
<html>
  <head>
    <style type="text/css">
      <!--
        body { font-family: sans-serif; font-size: 12pt }
        div { margin-bottom: 5px }
        span.roll { background-color: #efefef; background-attachment: scroll; background-repeat: repeat }
        span.trustedprefix { background-color: #D8E9F6; background-repeat: repeat; background-attachment: scroll; color: #000000 }
      -->
    </style>
   
  </head>
  <body id="body">
   

    <div>
      <table cellpadding="0">
        <tr>
          <td style="padding-right: 5px" valign="top" width="40">
            <img src="asset://1f5ffdc593cfe553ae7ade46afd1174c-40">
           
          </td>
          <td style="margin-right: 5px" valign="top">
            Lib:style:
          </td>
          <td valign="top">
           
          </td>
        </tr>
        <!-- Custom stylesheet.  "@this" will not work -->
        <!-----===== OnCampaignLoad =====------>
       

        <tr>
          <td>
            HTML START

            <p rel="stylesheet" type="text/css" href="styles.css@Lib:style">
              paragraph <em>of text</em>.
            </p>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>

From what I can tell, when 'onCampaignLoad' macros are loaded, there is absolutely no output to chat. The output above was generated by clicking on the 'onCampaignLoad' macro manually.

Next, notice in the html how the macro output was not simply 'dumped' to the chat?
  • The <b> tags around the first line of actual text are missing
  • The <link> tag is missing, but the comments are still there (between rows of the formatting in chat?) :?
  • the attributes of the link tag in the first line have been added to the <p> tag later on. :shock:

So, no go on the "sneak a stylesheet in during chat load" idea :(

Azhrei wrote:
Some day we'll have an entry in the Campaign Properties where the GM can provide a URI to a global stylesheet. But don't hold your breath.

I would actually consider this an accessibility issue. The current preferences allow you to change the size of the font, but not the font face, or colours. Or all other manner of things CSS is designed for.
What about a text box in the "Accessibility" tab of the application preferences where a user could write/paste a personal stylesheet, which is loaded in the header of the chat html?

I don't know anything about the technicalities of how the chat is rendered, I'm just thinking from a user perspective. But, I can see it being a choice between loading all the CSS once at the beginning, or trying to re-draw the entire chat panel () with new CSS rules.
What about a compromise whereby the chat html & CSS is re-loaded when it is cleared (/clr), including a custom statsheet?

_________________
"The trouble with communicating is believing you have achieved it"
[ d20 StatBlock Importer ] [ Batch Edit Macros ] [ Canned Speech UI ] [ Lib: Math ]


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Tue Jun 29, 2010 10:56 pm 
biodude wrote:
I don't know anything about the technicalities of how the chat is rendered,

Well, I'm no expert but I know a little about it. And from what I've seen, the Stylesheet object would need to be applied to each Document object after it's created. That means anywhere in the code that pops up an HTMLPane (and hence instantiates a Document object), anywhere that has HTML inside a label or button or checkbox or dropdown list, or anywhere else that HTML is rendered would need to have the Stylesheet object assigned to it. And that's a whole boatload of code we're talking about changing!

Quote:
I'm just thinking from a user perspective.

The UI is not a problem. There are lots of ways to answer the question of how to get the CSS into the program in the first place -- that's a piece of cake. It's what has to be done with it once it's in there that's a problem. :(

We really need a better HTML rendering engine, but that's been discussed before as well. I weighed in on that discussion as did Craig, jfrazierjr, and Phergus (IIRC). It's a pretty old thread now; perhaps 8 months or so...?


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Wed Jun 30, 2010 7:31 am 
Azhrei wrote:
We really need a better HTML rendering engine, but that's been discussed before as well. I weighed in on that discussion as did Craig, jfrazierjr, and Phergus (IIRC). It's a pretty old thread now; perhaps 8 months or so...?


Yea, and as noted in that thread, "better" still does not mean compliant with the current html/css standards by any stretch, so it's not a be all, end all solution. Plain and simple java is just behind the times in ways to support current html standards... which is probably why browsers are not written in java very often.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Wed Jun 30, 2010 1:59 pm 
I just noticed JRex in a search. It is based on the Mozilla renderer.... The page had no specific information about HTML/CSS support, but I would expect that it would work fairly well since it's based on the Mozilla renderer(which I can't remember the name of now and don't have the time to look up ATM).

They have not tested on Mac, so that might be an issue... perhaps someone with a Mac can run their webstart demo???

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Wed Jun 30, 2010 6:14 pm 
You're thinking of Gecko?

Apple has done a lot of work on WebKit but it's written in C++, IIRC. Still, might be interesting to add a JNI that provides access to it from Java. It's super fast, very standards compliant, and open source (although I don't know what the license details look like).

If I get a chance I'll take a look at that demo at some point...


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Mon Feb 09, 2009 10:53 am
Posts: 419
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Tue Nov 29, 2016 9:16 pm 
This thread is ancient, but I feel like renewing the request for using stylesheets inside macros' output to chat.
It would be very helpful and pleasant.

Also, a general upgrade of HTML and CSS wouldn't be bad, since certain tags/options still can't be used in MapTool, and they'd help much into formatting output.

_________________
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1704
Location: Chicagoland
 Post subject: Re: [1.3.b69] CSS and Chat
PostPosted: Tue Nov 29, 2016 10:43 pm 
Moving to JavaFX should open that up for us. It's a plan, just a, "ug, ok who's redoing all the UI for us?" thing. It's usually an all or nothing thing (although you can mix swing and FX components, they operate on different threads so you have to mind your p's and q's...)

We should then be able to use HTML5 and all that... And of course, while updating the UI there may be a lot of new components we can toss in to add functionality, add in multiple chats, separate logs from chats, etc...

Only thing we need is time. Anyone have some surplus to throw at us? :)

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman