LWUIT HtmlComponent Lines don't get wrapped + Parser Problem - xhtml

I think I'm facing a simple layout problem.
I'm embedding a HTMLComponent on a Form via LWUIT, this HTMLComponent
displays a local HTML file. The result has no line wrapping but endless
scrolling in X direction.
How can I change this behaviour?
I also have some tags in the files which aren't really supported.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><doc><head><title>
How can I still parse the files, without removing those tags manually?
Do I need to modify my DocumentRequestHandler or where can I do that?
Best Regards

For the line warpping, please check if any specific "width" is defined in you local HTML (or CSS) file. For example, if the width is given as "600" pixels and the screen is less than "600" then scrolling may appear. So either remove the specific width or change it to "100%".
Hope this helps.

Related

Interactive SVG in WordPress

I've designed and coded an interactive SVG that I've had to implement as HTML in WordPress because it only acts as a useless static image if it's entered as an SVG in an image block.
So far, that means that it's not responsive and loads at full size on a phone. I want people to see it in full, straight away, not zoom out to see it.
Is there another way to make it work without being an HTML dump? And even as code, how would I reduce it to fit screen sizes? Bearing in mind that my brain may implode if you suggest coding breakpoints or something like that.
I'm using a Blocksy child theme with no page builder.
The code itself works fine so there seems no point in me pasting a shortened version of the code. The page is here, if that helps.
Www.orderaround.co.uk
Right, I've fixed it myself. All I needed to do was remove the width and height specifications from the beginning of the svg code. It now fits to whatever container it's being displayed in.

IPython Notebook: unnecessary scrollbars in output_area when using `display(Latex(...`

I have the following modification to the notebook style sheet
.output_area {font-size: 101%;}
i.e., I'm slightly increasing the size of the default font.
Using print(... I have absolutely no problem, while using display(Latex(... I have what looks like a totally unnecessary scrollbar, see picture below, where you can also see (part of) the code that produced the output.
Is it possible to increase the size of the fonts in the output_area without introducing the unnecessary scrollbar?
Tx in advance, g
Edit: I forgot to mention, w/o the css modification there is no scrollbar...
Put overflow: hidden; in the css (I do it for pre as well)
I think this will mess up really long output cells but I don't have any.
You can also use div.output_latex {...} to format only latex, which is really mathjax in the browser.
The easiest way to figure it out is to right click on the part you want in Chrome and choose developer tools (other browsers may have similar tools).
You can see that the overflow is last set in output_subarea so you have to overwrite it after that block is read. You can make another style section "output_subarea" or just put it in the "output_latex" section.
The "output_area" section is the whole wrapper for output including the place with Out[nn]: .

Firebug displays incorrect line numbers

I edited some files (CSS and PHP) on a website. Now Firebug (2.0.9) displays the same line number for every CSS rule within the Style side panel. I've tried uninstalling and re-installing Firebug - no luck.
Even on this website, every rule I inspect says (line 1).
Anyone knows how I can get Firebug to display the correct line numbers again?
Since you say the changes were to the files, not to Firebug, I would say the issue is the CSS file and Firebug is reporting the line number correctly. That is to say there is no new lines in the file - all rules are on a single line.
Take a look at the .css file in a basic text editor and make sure the white space hasn't been removed. If it has, you may still see the text wrap and look to be on separate lines but this is just how the editor is showing it - word wrap can usually be turned on/off in editors.
If it looks like a big block of text then your CSS has been minified most likely.

Enhanced image plugin not working correctly when custom styles have been applied

For my website we use custom style sheets that are stored locally on our server and are injected into the webpages. However when i add them to CKEditor and then attempt to resize or move an image with the enhanced image plugin they cannot be resized or moved at all. Has anyone encountered this problem before? Is there anyway around it?
edit: So i add my css files using
config.contentsCss = ['http://fonts.googleapis.com/css?family=Droid+Sans',
'http://fonts.googleapis.com/css?family=Bree+Serif',
'http://fonts.googleapis.com/css?family=Droid+Sans+Mono',
'http://192.168.0.50/css/new/all.css?v=1" media="all',
'http://192.168.0.50/css/new/templates.css?v=1',
'http://192.168.0.50/css/pre_review/colors.css?v=1',
'http://192.168.0.50/css/pre_review/paged_test.css?v=2',
'http://192.168.0.50/css/pre_review/bootstrap.min.css?v=1',
'http://192.168.0.50/css/pre_review/main.css?v=1',
'text/css'];
I have also installed the Enhanced Image plugin to allow me to resize and move images around. however when i insert an image on to the page the source looks like
<p><img alt="" height="239" src="http://icons.iconarchive.com/icons/yellowicon/game-stars/256/Mario-icon.png" width="239" /></p>
when i originally set the image width and height in the popup panel i set the values to 2 and 2, these values do nothing to edit the actual size of the image. It still displays at the full size of 239x 239.
I know that it is my added styles that are causing this error as it works fine without them, However i do need them. is there anyway around this without having to remove the styles?
First of all, your contentsCss has some weird parts like the last item or this 'http://192.168.0.50/css/new/all.css?v=1" media="all'. Please verify that all this works. Incorrect rules may affect CKEditor.
Second, the issue may be very simple - your CSS most likely affect widgets styling. Disable loading your CSS files one by one and see which one breaks the Enhanced Image plugin. Then find the rule that breaks it and then improve the rule so it does not affect images.

Changepic and keep original image size with adjust parameter

I have a template in which I'm attempting to change the source of a picture from Image 1, to Image 2 - yet I want Image 2 to keep the original size it was uploaded to the server in. (I want it in the position of Image 1, but its own dimensions.)
To do this, I figured I needed to use the adjust parameter - which I have attempted. The description for adjust=100% is "The picture is adjusted to be proportional to the original size." - which sounded like what I needed to do.
However, in my docx output, this seems to set the image size to be 100% of page width, rather than related to image size. (In the word image properties, it shows my image to be 208%, so I don't think it's related to my file!)
Is this a bug in opentbs, or have I misunderstood the docs? If so, how should I be doing it, or otherwise, can anyone thing of a work around? I attempted not using adjust at all, however that seems to have the same behaviour as adjust=inside - which I presume is the default.
With the normal thanks for a great tool!
Edit: The Error causing tag is below. I've found the problem reproducible when starting from nothing, and with just an image in the word doc. Word 2010, OpenTBS 1.8.
[onshow.logo;ope=changepic;tagpos=after;adjust=100%]
The problems was caused by the TbsPicAdjust() function expecting the image's dimensions to be provided in points, rather than pixels, as php's getimagesize() function was returning.
It was solved by replacing the two fixed coefficients in the TbsPicGetDim_OpenXML_dml() function with 9,525, rather 12,700 as they were originally coded. (Which would be an appropriate value, if the dimensions were in points, rather than pixels.)
After some research, from what I can see, getimagesize() always returns a size in pixels rather than points, so it looks to me like this could be a potential bug?
Additional Source for coefficient, combined with personal calculations: http://openxmldeveloper.org/discussions/formats/f/15/p/396/933.aspx
Workaround:
It depends if you are using the new (.docx) or old (.doc) style of document. If you have the newer style, I don't know for sure that you can change the image size without putting the tag directly into the XML. The older (VML, I believe) style uses <v:shape> to describe a picture rather than <pic:pic>. With v:shape, you can just put together a CSS-style string that describes the size, etc. of your image. Something like:
$imgStyle = "position:absolute;left:0;top:0;width:800;height:600"
Then you just have a tag next to your changepic tag; something like:
[imgStyle;att=v:shape#style]
The newer style does not use a style string like this to size and position images, the pic:pic element is full of nested tags describing the image so it is harder to get to the details (though you could certainly try). I ended up creating a subtemplate for my image switching because my template is in the new format with compatibility for the old format (so I have to maintain two image blocks). This allows me to maintain the XML directly for the image dimensions, but still be able to edit my main template in Word. I just use a tag in my main template that includes the subtemplate like:
[LineItem.template;block=w:r;file='img.xml']
Separating the manually controlled XML out allows me to edit the main template in Word without damaging the really custom parts. Using this technique though, you may have some trouble with onload/onshow tags in the subtemplate - everything I change in the subtemplate is controlled by a block.

Resources