Writing Pure HTML in Jade - webgl

Jade appears to choke on WebGL shader/fragment blocks when writing in Jade format, so I would like to write them as straight HTML while still being able to write Jade around it. Is this possible?

These:
html
body
| <h1>Title</h1>
| <p>foo bar baz</p>
compiles into:
<!DOCTYPE html>
<html>
<body>
<h1>Title</h1>
<p>foo bar baz</p>
</body>
</html>
hope it helps

Related

Why does Microsoft Edge have a url here

I've simplified it down to this html:
<html>
<body>
Test_170185.00000
</body>
</html>
On Edge I get:
On Chrome and Firefox I get something like:
When I inspect on any of them I just get the plain html back.
What is going on here?
Here's a jsfiddle: https://jsfiddle.net/dtrubb5z/
In Edge (41.16299.371.0):
In Chrome (or anything else) :
Edge detects it as a phone number and decides to style it. The only way I know to disable it is this:
<html>
<body>
<p x-ms-format-detection="none">Test_170185.00000</p>
</body>
</html>
Their documentation is here
https://msdn.microsoft.com/en-us/library/Dn337007

jQuery UI - how to show progress bar on top of page just when loading

I would like to use jQuery progress bar and add it to the top of the page only when the page is loading (and make it disappear afterwards), a behavior which is somehow similar to the progress bar in GitHub:
.
How can I do that?
I currently have the following HTML code:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
</head>
<body>
<div id="content">
<div id="progressbar"></div>
<div id="my-content">
My page content goes here....
</div>
</div>
</body>
Javascript:
$('#progressbar').progressbar({
value: false
});
I'd advise you to use NProgress. It's not using jQuery-UI, but it's really slim and easy to integrate. I've used it in several projects and it worked fine.
With NProgress you don't have to have HTML code, you just need to run the following lines:
NProgress.configure() if you need some special configurations
NProgress.start() to start the progress bar
NProgress.inc() to increment the progress
NProgress.done(true) once progress complete
That's it! Very easy!
I’d suggest using PACE (http://github.hubspot.com/pace/docs/welcome/). It does exactly that and makes it very easy to customize!

angular.dart seems to be slow

I am trying angular.dart and saw that its slow. When am html page is loaded containing angular, angular directive is seen first, which are then converted appropriately. Shouldn't it be converted instantaneously and the user should not see whether we are using angular ?
<!DOCTYPE html>
<html ng-app>
<head>
<title>Hello, World!</title>
</head>
<body>
<h3>Hello {{name}}!</h3>
name: <input type="text" ng-model="name">
<script type="application/dart" src="main.dart"></script>
<script type="text/javascript" src="packages/browser/dart.js"></script>
</body>
</html>
Surround {{name}} with a tag having class="ng-cloak". I used span tag. Keep it hidden by specifying css rule .ng-cloak{ display:none; }.
When angular is loaded, it will remove class="ng-cloak" from the span tag and everything will work as expected.
<!DOCTYPE html>
<html ng-app>
<head>
<title>Hello, World!</title>
<style>
.ng-cloak{ display:none;}
</style>
</head>
<body>
<h3>Hello <span class="ng-cloak">{{name}}</span>!</h3>
name: <input type="text" ng-model="name">
<script type="application/dart" src="main.dart"></script>
</body>
</html>
An alternative way is to use ng-bind as demonstrated in this youtube video: AngularJS MTV Meetup: Best Practices (2012/12/11) (after about 12 minutes)
Quoted from the API doc of NgBindDirective class
Typically, you don't use ngBind directly, but instead you use the
double curly markup like {{ expression }} which is similar but less
verbose.
It is preferrable to use ngBind instead of {{ expression }} when a
template is momentarily displayed by the browser in its raw state
before Angular compiles it. Since ngBind is an element attribute, it
makes the bindings invisible to the user while the page is loading.
This way you can display default content that get's replaced when Angular is ready
instead of showing a blank page or a progress icon.

JavaFX Webview letter-spacing Bug?

Currently I am using the JavaFx Webview to load a HTML page. But there is a problem when it loads the HTML page. It doesn't read the letter-spacing or -webkit-letter-spacing attribute in CSS. It's fine with the Chrome browser. How can I make it work in JavaFx?
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>test</title>
<style>
.text {
letter-spacing: 20px;
}
</style>
</head>
<body>
<div class="text">
abcdefg
</div>
</body>
</html>
Looks like this property is not supported in JavaFX/JDK 7, but works for me in JavaFX/JDK 8. As far as I know, some of the WebViews rendering bugs fixed in JDK 8 won't be backported to JDK 7 and this one seems like being one of such bugs.

tool for show better code(color code) in html like stackoverflow code sample

in stackoverflow editor have button call "Code Sample"
which any code write this block in present time show color code
like
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
i know this is java script code because when page load, normal text code changed to color text code
but:
what is name of this tool
how can i add this tool to my blog or website

Resources