Use CSS to set units to px (where no unit defined) - width

The problem: Old dinosaur working with outdated html/css styling. This dude managed to enter a whole bunch of input field sizes using
Style='width:80' and similar. That's right, without any 'px' or anything.
Now this works satisfactorily in MSIE 10 and above as well as Chrome and Firefox, but unfortunately the interface also has to support MSIE 9 (I have not even dared to attempt MSIE 8....) and MSIE 9 really does not like this. Fields just seem to have some random/default length and everything looks horrendous.
Replacing all the instances of this is a task more daunting than coming back from the dead (a general replace will only be moderately useful) so the question is...
Is it possible to set "THE" unit in CSS so that it is applied to all fields that are missing one? Use of jQuery is OK, it is already jQueried up the wazoo so that's fine. But please tell me this is at all an available option... or I shall find myself going mad replacing 1000+ fields...

No, it is not possible. Units must always be defined, except for value 0.
But it shouldn't be that daunting, surely a regexp or two will handle it?

does file search and replace with sublime text like Style="width:(.*?)" with Style="width:$1px" work for you?

Related

Previewing and Typing in Unicode font (Private Area / Basic Multilingual Plane) in Linux for SMuFL

I would like to make a change to an open source Android app which uses the Bravura font implementing the Standard Music Font Layout (SMuFL) fonts. I am developing on Linux.
The app displays musical notes with things like
<string name="notef_c5"> == ==</string>
which is displayed like
I now need to change things and I would like to see what I am going to do, rather than semi-randomly changing the Unicode numbers and see what happens. So I installed the font on my Linux desktop from github, by simply copying the SVG that the app is using into my global font directory and that did not work (fc-cache said /usr/share/fonts/svg/Bravura: caching, new cache contents: 0 fonts, 0 dirs). The same procedure for the OTF did work. This could be a problem down the line, since the app is using slightly modified version of the SVG, so any hint on that could help, but it's secondary regarding the question.
In fact I want to use "something" to display the font, and I tried many things, including Charmap and FontManager (which is almost the same as FontViewer). Charmap is the worst, displaying basically every single font installed on the machine even if I select just the Bravura (why is that???!) -- FontManager does the same (???!) -- FontViewer is almost passable, in that (when the "Characters" tab is selected) it display empty squares for the characters not defined in Bravura. Therefore with lots of careful scrolling it displays the "actual things" I am looking for, but it does not show their unicode values, and it's an extenuating search of few actual characters in a huge ocean of empty squares. So it's a no go anyway.
Is it possible that the best solution is just to blindly type Unicode values as described in the docs and see what happens? I know, if I were running Windows or Mac I could use Dorico SE but more generally there must be a better way of using Unicode in Linux, perhaps built for other purposes?
If you’re looking for specific symbols in the SMuFL specification, the full list of glyphs is available on the SMuFL website. (Note that the fonts themselves know nothing about music typesetting, they are simply collections of shapes to be used by a typesetting program. Even the simple example you provided is a composite of several carefully scaled and positioned glyphs, and simply changing the character codes may or may not work as intended.)
If you’re looking for ways to input Unicode characters on Linux, see the many suggestions provided here: How to type special characters in Linux?

Connection between svg elements

Is there a way to connect 2 elements in svg to achieve a "flow chart" like diagram? I have 2 boxes, an arrow between them, and I would like that if I drag one box, the arrow stays connected to the box.
I've founded that there is a spec for this feature in SVG 1.1 but is far from being completed.
I can't find any piece of code or library that does it (and I think it isn't a rare use case), and I would like to be sure that there isn't a proven way of doing it before I start making it myself.
Thanks!
You may be interested in the Dracula Graph Library which uses Raphael and does exactly what you mean:
http://www.graphdracula.net/
Update: I haven't used jquery-svg before, but I put something small together that may get you going: http://jsfiddle.net/7vJmy/2/
It takes advantage of jquery-ui draggable, but I suspect there's a nicer way to do it using the jquery.svganim.js package that's include with the library - anyway, this is all I have time for now.
Also, if you can in the future, include things like library restrictions in the question so you can get more specific answers from the get go! :) Hope that helps.

Browser based Code Editor, with real tabbing?

I'm currently using CodeMirror as a browser based code editor, but what really annoys me is its lack of real tabbing. It uses spaces instead of tabs, and I just cant get my code as clean as desktop editor.
Are there any better editors out there? It can be DOM based or Javascript or even browser specific, just as long as it gives me real tabs! :)
PS. I've had a look at Ace, which looks like it should do the job, but I cant seem to get real tabs to work - anyone tried it?
Cheers,
Chris.

Is there a way to change how tab characters are rendered in a browser?

Specifically in Firefox. We look at code in the browser often, and I am wondering if we could configure the browser so that tab characters show up as 4 spaces wide, instead of the default 8 spaces.
Edit: no responses yet. So I assume this is not possible?
Not really the answer you are looking for but maybe you could replace the tab characters with the appropriate amount of spaces and use the "pre" tag?
It is definitely worth looking at the html source to see how sites like stackoverflow.com deal with displaying source code.

How do you handle very old browsers on your site?

We have a non-profit web site that got about 5 million hits in May. Of those, about 5,700 were from IE 5.x or lower; about 4,000 were from folks with Netscape 4.x or lower. We know that the current site's layout works for newer browsers and we're testing it on IE6 as well (along with Chrome, Opera, Safari, and Firefox). How do you handle the folks with the older browsers? Because of jQuery libraries and such, the pages might not function correctly on those old browsers.
Is there an easy way to show a text-only version on browsers that can't handle the CSS and jQuery goodies? How do large sites handle this sort of thing? I've used the #embed to hide the stylesheet from Netscape 4.x, but not sure beyond that.
You should not keep the old browsers as your main priority - just keep the content readable on them, and maybe add a helpful banner that explains they are using an outdated browser.
However, you don't have to focus on getting the layout look 100% same on browsers that old, that's just waste of time. As long as the content is available and they can navigate the site, it should be fine.
Make sure that all content is accessible and readable from a browser like Lynx, and no content requires Javascript to read & access.
I would suggest designing for disability accessibility and seeing if that would produce those results as well - kill two birds with one arrow.
If you use tableless / css based design techniques then you can easily fall back to text only.
You could use conditional comments to only include css files in certain version of internet explorer.
You could use jquery version checking to only execute it on the versions you want to.
Something else I just thought is that you could show a message to older browsers like I have seen around the web urging the user to upgrade for compatibility and most importantly SECURITY. (I think twitter is doing this now).
And another thought - if you are going back to browsers that old you are probably going to have to worry about screen size as most sites as designed to fit 1024 x 768 minimum these days but at once point 800x600 was the entry level...
Here is what Big G has to say about it :)
http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html
They are going to stop supporting IE6...

Resources