less setup is not working - css

I tried to install less, but it's not working.
Firebug report this error :
Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
My code :
<link type="text/css" href="http://static.mydomain.com/css/colors.less" rel="stylesheet/less" />
<script type="text/javascript" src="http://static.mydomain.com/js/less-1.2.2.min.js" ></script>
Header of .less file :
Accept-Ranges bytes
Connection Keep-Alive
Content-Length 889
Content-Type text/css
Date Thu, 10 May 2012 16:56:51 GMT
Etag "5cbb93-379-4bedaed496200"
Keep-Alive timeout=5, max=100
Last-Modified Mon, 30 Apr 2012 00:56:40 GMT
Server Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6
And its content :
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
Is someone has an idea ?

Ok, I found. just had this into your httpd.conf apache file :
Header set Access-Control-Allow-Origin "*"

Related

How to Fix error in javaFx error Message?

I'am using CSS file with JavaFX (scene builder),I ran into a problem that I couldn't find a solution for.
I searched a lot and couldn't find a solution to this problem
.linear-grad {
-fx-background-color: linear-gradient(to bottom left,#5f0a87,#a4508b);
}
.button1 {
-fx-background-color :#5F0E81;
-fx-text-fill:#ffffff;
}
.button1:hover{
-fx-text-fill:#6E1988;
}
.button1 :pressed {
-fx-text-fill:#CEB2D7;
}
.button1 :active {
-fx-text-fill:#B184BF;
}
.button2 {
-fx-background-color :#863684;
-fx-text-fill : #ffffff;
}
.button2:hover{
-fx-text-fill:#994984;
}
.button2:pressed {
-fx-text-fill:#BB85AD;
}
.button2:active {
-fx-text-fill:#BB85AD;
}
Error Massage :
Dec 31, 2021 5:42:23 PM javafx.css.CssParser term
WARNING: CSS Error parsing '*{-fx-background-color: linear-gradient : (to bottom left,#5f0a87, #a4508b);}: Unexpected token ':' at [1,40]
Is there anyone who can help me solve this problem?
try this
.linear-grad {
-fx-background-color: linear-gradient(to bottom left, #5f0a87, #a4508b);
}
.button1 {
-fx-background-color: #5F0E81;
-fx-text-fill : #ffffff;
}
.button1:hover {
-fx-text-fill: #6E1988;
}
.button1:pressed {
-fx-text-fill: #CEB2D7;
}
.button1:active {
-fx-text-fill: #B184BF;
}
.button2 {
-fx-background-color: #863684;
-fx-text-fill : #ffffff;
}
.button2:hover {
-fx-text-fill: #994984;
}
.button2:pressed {
-fx-text-fill: #BB85AD;
}
.button2:active {
-fx-text-fill: #BB85AD;
}

MeteorJs: Payment Integration(PayUMoney) Checksum failed

I am working on MeteorJS(nodeJS). Trying to integrate payUMoney on localhost. I am having live credentials and forwarding my HTTP call to :
POST URL: https://secure.payu.in/_payment.
On console I am getting status code as 200. But not directing to payu.com But on console I am able to see "checksum failed" error. I tried to packages:
1.jparker:crypto-sha256
2.johnschult:crypto-sha512
This is my piece of code:
var string = key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|||||||||||'+salt;
var SHA = CryptoJS.SHA256(string);
Also tried like this:
var string = key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+'|'+salt;
var SHA = CryptoJS.SHA256(string);
console.log("SHA :" + SHA);
this.unblock();
var payUMoneyInput = {
"key" : key,
"txnid" : txnid,
"amount" : amount,
"productinfo" : productinfo,
"firstname" : firstname,
"email" : email,
"phone" : phone,
"surl" "http://localhost:3000/onlinePaymentSuccess",
"furl" : "http://localhost:3000/onlinePaymentSuccess",
"hash" : SHA,
"service_provider" : "payu_paisa",
};
try {
if (Meteor.isServer) {
var result = HTTP.call("POST", "https://secure.payu.in/_payment",
{params: payUMoneyInput});
console.log(result);
return result;
}else{
return false;
}
}
} catch (err) {
console.log('range error');
console.log(err)
// Got a network error, time-out or HTTP error in the 400 or 500 range.
return false;
}
My console looks like below:
0427-12:52:44.069(5.5)? SHA :f071c643368745b38f8b41851d6500743190aa79426e931a28ccfd65135d94ed
I20170427-12:52:44.237(5.5)? { statusCode: 200,
I20170427-12:52:44.237(5.5)? content: '<!DOCTYPE html>\n<!--[if lt IE 7 ]> <html lang="en" class="no-js oldie ie6"> <![endif]-->\n<!--[if IE 7 ]> <html lang="en" class="no-js oldie ie7"> <![endif]-->\n<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->\n<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->\n\n\n<!-- Custom Modernizr build (should always be on the top) -->\n<script src="js/modernizr-2.0.6.min.js"></script>\n <script language="javascript">\n document.title = "Transaction Error";\n </script>\n\n<style>\n body {font-family: \'Arial\'}\n .container {width: 960px; margin: 0 auto; padding: 15px 0;}\n\n #header {border-bottom: 1px solid #ccc;}\n #content {padding: 100px;}\n #content h1 {font-size: 70px; color: #358DCB; margin-bottom: 0; margin-top: 0; text-align: center}\n #content h2 {font-size: 16px; margin-top: 0; text-align: center}\n #content p {font-size: 14px; margin-top: 30px; line-height: 24px; padding: 0 150px;}\n\n #footer {border-top: 1px solid #ddd; font-size: 12px;}\n #footer p {margin-top: 0;}\n\n #footer a {text-decoration: underline}\n</style>\n\n<div id="header">\n <div class="container">\n <img src="https://static.payu.in/images/payu_logo.png">\n </div>\n</div>\n<div id="content" >\n <div class="container">\n <h1>SORRY!</h1>\n <h2>We were unable to process your payment</h2>\n <p style=\'text-align: center;font-size:13px;\'><br>Checksum Failed</p> </div>\n\n </div>\n\n<div id="footer">\n <div class="container">\n <!--<p style="float:left">© 2015 PayUBiz. All rights reserved.</p>\n <p style="float:right"><a target="_blank" href=https://www.payubiz.in/privacyPolicy >Privacy Policy</a></p>\n <p style="clear:both"></p>-->\n <p style="text-align: center">© 2015 PayUBiz. All rights reserved.</p>\n </div>\n</div>\n\n<script src="js/libs/jquery-custom.min.js"></script>\n<!-- <script src="./_js/plugins.js"></script> -->\n<script src="js/script.js?version=v2.0.10"></script>\n\n',
I20170427-12:52:44.237(5.5)? headers:
I20170427-12:52:44.238(5.5)? { date: 'Thu, 27 Apr 2017 07:22:44 GMT',
I20170427-12:52:44.238(5.5)? 'content-type': 'text/html',
I20170427-12:52:44.238(5.5)? 'transfer-encoding': 'chunked',
I20170427-12:52:44.238(5.5)? connection: 'close',
I20170427-12:52:44.239(5.5)? vary: 'Accept-Encoding, Accept-Encoding',
I20170427-12:52:44.239(5.5)? 'set-cookie': [ 'PHPSESSID=bpgqhvng7blpk1fltvrohle0j0; path=/; secure' ],
I20170427-12:52:44.239(5.5)? p3p: 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"',
I20170427-12:52:44.239(5.5)? expires: 'Thu, 19 Nov 1981 08:52:00 GMT',
I20170427-12:52:44.240(5.5)? 'cache-control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
I20170427-12:52:44.241(5.5)? pragma: 'no-cache',
I20170427-12:52:44.241(5.5)? server: 'Payubiz',
I20170427-12:52:44.242(5.5)? 'x-xss-protection': '1; mode=block' },
I20170427-12:52:44.244(5.5)? data: null }
Unable to track the problem. Thanks in advance!
According to payu integration document and formula at there your hash should be :
var sha=sha512(key +'|' +txnid+ '|' +amount+'|'+productinfo+'|'+firstname+'|'+email+'|||||||||||' + salt+'|');
var hash=CryptoJS.enc.Hex.stringify(sha);

How do I declare embedded css with Binding.scala

I tried to declare some embedded css with Binding.scala
import com.thoughtworks.binding._, Binding._
import org.scalajs.dom._
#dom def css = <style>
body {
background-color: lightblue;
}
</style>
dom.render(document.head, css)
However, I got the error message:
ScalaFiddle.scala:6: error: not found: type lightblue
background-color: lightblue;
^
ScalaFiddle.scala:6: error: not found: value background
background-color: lightblue;
^
ScalaFiddle.scala:6: error: not found: value color
background-color: lightblue;
^
How can I fix it?
You see the error message because { is a special character in Scala's XML literal.
Use a CDATA section in the style element.
#dom def css = <style>
<![CDATA[
body {
background-color: lightblue;
}
]]>
</style>
The { does not have special meaning in the CDATA section any more.
Note this CDATA approach only works when coalescing flag is on.
See https://github.com/ThoughtWorksInc/Binding.scala/issues/30 and https://github.com/ThoughtWorksInc/Binding.scala/issues/58 if you accidentally turns the flag off.
Using the answer of Yang Bo:
#dom def css = <style>
<![CDATA[
body {
background-color: lightblue;
}
]]>
</style>
Gives me an Exception:
ScalaFiddle.scala:22: error: overloaded method value domBindingSeq with alternatives:
( text: String)binding.this.Binding.Constants[raw.this.Text]
...
See https://scalafiddle.io/sf/ATMVpjV/0
This solved it:
#dom def css = <style>
{"""
body {
background-color: lightblue;
}
"""
}
</style>
See https://scalafiddle.io/sf/ATMVpjV/1

CSS theming of GtkCalendar marked days

I'm trying to modify existing theme .css files for a Linux Desktop (Ubuntu Unity in my case), so that they suit my needs. Looking at already existing themes I was able to reverse engineer most of it, but for some widgets I was not able to theme them properly. On of it are the marked days in a GtkCalendar.
What do I need to modify in the .css files so that I can modify the font-color of the marked days (the ones bold in the Calendar, i.e. Something is happening at that day; red rectangle). It is not the color property because color: only changes the color of the non-marked days (as it can be seen in the screenshot,28th December)
For reference: This is the file I'm trying to modify. It's written in SASS but that doesn't matter https://github.com/shimmerproject/Numix/blob/master/gtk-3.0/scss/widgets/_calendar.scss
This is just a placeholder to test the functionality.
gtk/theme/Adwaita/_common.scss | 10 ++++++++--
gtk/theme/Adwaita/gtk-contained-dark.css | 9 ++++++++-
gtk/theme/Adwaita/gtk-contained.css | 9 ++++++++-
3 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 6f70d4f..bcd5f80 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
## -2761,13 +2761,19 ## GtkCalendar {
text-align: center; /* haha, dream on */
}
.day.dim-label{ color: $insensitive_fg_color; }
-.day:selected {
+.day.day:selected {
color: $selected_fg_color;
background-color: $selected_bg_color;
padding: 0.4em;
border-radius: 3px;
}
-
+.day.holiday,
+.day.weekend {
+ background-color: transparentize(red, 0.9);
+}
+.day.marked {
+ font-weight: bold;
+}
/***********
* Dialogs *
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index c46cb5a..c593cc2 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
## -3678,12 +3678,19 ## GtkCalendar {
.header-bar .day.subtitle {
color: #939695; }
-.day:selected {
+.day.day:selected {
color: #ffffff;
background-color: #215d9c;
padding: 0.4em;
border-radius: 3px; }
+.day.holiday,
+.day.weekend {
+ background-color: rgba(255, 0, 0, 0.1); }
+
+.day.marked {
+ font-weight: bold; }
+
/***********
* Dialogs *
***********/
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 050dece..aca3a5b 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
## -3848,12 +3848,19 ## GtkCalendar {
.header-bar .day.subtitle {
color: #8d9091; }
-.day:selected {
+.day.day:selected {
color: #ffffff;
background-color: #4a90d9;
padding: 0.4em;
border-radius: 3px; }
+.day.holiday,
+.day.weekend {
+ background-color: rgba(255, 0, 0, 0.1); }
+
+.day.marked {
+ font-weight: bold; }
+
/***********
* Dialogs *
***********/

Shiny Server custom Handlebars.js templates

I'm not at all familiar with handlebars.js but I'd like to customize the directory index template that comes with Shiny Server. Specifically, what I'm looking to do is render a page of thumbnails of the different apps.
The file /opt/shiny-server/templates/directorIndex.html comes with the code below which reference a number of expressions including {{title}}, references to apps, dirs and files.
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
background-color: #F5F5F5;
}
pre, tt, code, .code, #detail {
font-family: 'Consolas', 'Courier New', 'Courier', monospace;
}
h1 {
font-size: 40px;
}
a {
text-decoration: none;
}
</style>
</head>
<body>
<h1>{{title}}</h1>
<ul>
{{#each apps}}
<li><a class="code" href="{{this.url}}">{{this.name}}</a> (application)</li>
{{/each}}
{{#each dirs}}
<li><a class="code" href="{{this.url}}/">{{this.name}}</a></li>
{{/each}}
{{#each files}}
<li><a class="code" href="{{this.url}}">{{this.name}}</a></li>
{{/each}}
</ul>
</body>
</html>
So I have two questions.
First - how can I know what expressions are available to call?
Second - give that I just have this one html page (as far as I can tell) how do I register a helper, e.g.
Handlebars.registerHelper('splitURL', function(url) {
var t = url.split("/");
return t[1];
});
I had the same desire to customize the directoryIndex.html template and enjoyed the same lack of documentation about what handlebars expressions could be used. I'm not a web developer so the code here is probably rubbish, but it works well enough. It sounds like you already solved your issue, but others may find some use in this approach. Images for each app are saved in site_dir/images.
screenshot of end result
directoryIndex.html:
<!DOCTYPE html>
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<link href="main.css" rel="stylesheet">
<script type='text/javascript'>
function include(arr,obj) {
return(arr.indexOf(obj) != -1);
}
function updateView(data) {
//update title and heading
if ("title" in data) {
var host = document.location.hostname;
if (host in data.title) {
document.title = data.title[host];
document.getElementById("title").innerHTML = data.title[host];
} else if ("default" in data.title) {
document.title = data.title.default;
document.getElementById("title").innerHTML = data.title.default;
}
}
//hide cards (for directories like /images)
if ("ignore" in data) {
var element;
for (var i in data.ignore) {
if (element = document.getElementById("card_"+data.ignore[i])) {
element.parentNode.removeChild(element);
}
}
}
//update each shiny app if it has JSON data
if ("apps" in data) {
for (var item in data.apps) {
if (document.getElementById("card_"+item)) {
if ("img" in data.apps[item])
document.getElementById("img_"+item).src = "/images/" + data.apps[item].img;
if ("name" in data.apps[item])
document.getElementById("name_"+item).innerHTML = data.apps[item].name;
if ("desc" in data.apps[item])
document.getElementById("desc_"+item).innerHTML = data.apps[item].desc;
}
}
}
}
function loadJSON(url) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data = JSON.parse(this.responseText);
updateView(data)
}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
document.addEventListener("DOMContentLoaded", function() {
loadJSON("data.json");
});
</script>
</head>
<body>
<div id="title_bar">
<h1 id="title"></h1>
</div>
<div id="apps">
{{#each dirs}}
<div id="card_{{name}}" class="card" onclick="location.href='{{url}}';" style="cursor: pointer;">
<img id="img_{{name}}" src="" alt="{{name}}" onerror="if (this.src != '/images/missing.png') this.src = '/images/missing.png';">
<div class="container">
<h4 id="name_{{name}}">{{name}}</h4>
<p id="desc_{{name}}"></p>
</div>
</div>
{{/each}}
</div>
</body>
</html>
data.json (located in the site_dir root location):
{
"title": {
"default": "Shiny Server",
"dev_host": "Shiny Server (Development)",
"accp_host": "Shiny Server (Acceptance)",
"prod_host": "Shiny Server",
"dev_host.fully.qualified.name": "Shiny Server (Development)",
"accp_host.fully.qualified.name": "Shiny Server (Acceptance)",
"prod_host.fully.qualified.name": "Shiny Server"
},
"ignore": [ "app_4", "app_5", "images" ],
"apps": {
"app_1": {
"name": "app 1 name goes here",
"desc": "app 1 description goes here",
"img": "app1.png"
},
"app_2": {
"name": "app 2 name",
"desc": "app 2 desc",
"img": "app2.png"
},
"app_3": {
"name": "app 3 name",
"desc": "",
"img": "app3.png"
}
}
}
main.css (located in the site_dir root location):
body, html {
font-family: Helvetica, Arial, sans-serif;
background-color: #F5F5F5;
color: #114;
margin: 0;
padding: 0;
}
#title_bar {
height: 80px;
background-color: #3475b4;
overflow: hidden;
border-bottom: 1px solid #3475b3;
-moz-box-shadow: 0px 0px 10px 3px #BBC;
-webkit-box-shadow: 0px 0px 10px 3px #BBC;
box-shadow: 0px 0px 10px 3px #BBC;
}
#title_bar h1 {
margin: 14px auto .5em auto;
padding: .2em;
color: #EEE;
text-align: center;
}
#apps {
margin-top: 14px;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
border-radius: 5px;
width: 300px;
margin: 10px;
display: inline-block;
vertical-align: top;
}
.card:hover {
box-shadow: 0 12px 24px 0 rgba(0,0,0,0.2);
}
.card img {
display: block;
margin: 0 auto;
max-width: 300px;
max-height: 250px;
}
.container {
padding: 2px 16px;
}

Resources