mardi 4 août 2015

how to make use fake ui permanent in chrome?

I have made an application to record a video by following this steps : http://ift.tt/1vdZW0w,

I want access to allow the camera always 'allow', i've tried bypass the allow permission in popup allow webcam use start chrome --use--fake-ui--for--media-stream and it's work for me, but when i closed my chrome and then i opened chrome again , the popup permission allow webcam still showing, what's the solution?

How can I stop my function from returning "Reference error: (...) is not defined"

I've got this code and it's returning that reference error, but I have no idea why, I've seen lots of Q&As about reference errors, but I still can't find it. Any help is appreciated.

Thanks in advance and may the force be with you.

My code:

 var data = '[{"name":"node1","id":1,"is_open":true,"children":[{"name":"node2","id":6,"children":[{"name":"child3","id":7}]},{"name":"child1","id":2}]}]';

 var dadSon = [];

 (function printDadSon(data, parent) {
   if (!data) return;
   for (var i = 0; i < (data.length); i++) {
     if (parent && parent != 'undefined') {
       console.log('Dad: ' + parent + ' & Son: ' + data[i].id);
       dadSon += ('Dad: ' + parent + ' & Son: ' + data[i].id);
     }

     printDadSon(data[i].children, data[i].id);

   }
 })(JSON.parse(data));

 printDadSon(data);

Hover effect working on most browsers, but not on safari or chrome on a MAC

In my html document, there are some tiles with two pictures (one jpg as a background and one png with transparency as a foreground) and with a hover effect: On the current tile which you are hovering, the image gets zoomed where your mouse is and the front image gets moved away from the cursor.

While moving the cursor only horizontally, all vertical pictures are animated too and the other way round.

Here is an example with all html, javascript and css:

http://ift.tt/1HnyaQb

The effect is working (with a few bugs, but that's not important).

The animations are easily added with javascript and transform3d where item is the current tile with the class .item. Variables like topRatioFron are calculated from the current mouse position relative to the current tile.

item.find('.front').css('transform', 'translate3d(0,' + topRatioFront + 'px,0)');
item.find('.back').css('transform', 'translate3d(0,' + topRatioBack + 'px,0)');

There are some variations which you can see in the jsfiddle javascript code.

The main tile gets animated with a matrix3d effect:

self.find(itemClass).css(
    'transform', 
    'matrix3d(1,0,0.00,' + leftRatio + ',0.00,1,0.00,' + topRatio + ',0,0,1,0,0,0,0,1)'
);

In the Google Chrome Browser on Linux Mint, it works perfectly. On Google Chrome on Windows, it works too. In Mozilla Firefox, it's not as perfect as in Google Chrome, but it's okay.

The actual problem

A friend opened this site on a Mac with Safari, and all animations were really laggy (it looked like it was shaking). Another friend opened this on a Mac in the Chrome browser, and it was shaking too, but this time not in Safari.

How can I test or find out what this is causing? It can't be the performance of the computer they used, because this site with the same effect is working perfectly in ALL browsers, regardless of the operating system.

What I tried

First, I used translate instead of translate3d (I read that the latter is faster), but It didn't help.

I later added a function called requestAnimationFrame which can help rendering animations. The result was the same.

How to use Different Button in bootstrap Form

I have used Bootstrap and created form.my form Looks like

<form action="default_results.php"   method="post" class="calculator"  name="frmCalculator">  

I have used this code in the beginning of my code and end of the page I have used three button Looks like

              <div class="row">

                            <button id="button2" class="dont-compare shadow-inset" value="reset" >
                                    Reset</button>
                            <button id="button3" data-toggle="pop" class="dont-compare shadow-inset" class="update" >
                                    Update MI</button>
                            <button id="Button4"  class="dont-compare shadow-inset" class="calculator" >
                                    Calculate Scenarios</button>
              </div>

I have another page its called default_ results.php page. I want to load that page when I click Calculate Scenarios button.I have used href tag for that button. But that three button also load default_results page.

How to set particular button? please any idea about it?

How to get value of a HTML tag receiving from ajax call

I am receiving below html from vbscript page by ajax call.

<html>
<body>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td width="100%" valign="top">
                    <div id="xyz"></div>
                    <input name="a1" type="hidden" value="">
                    <input name="a2" type="hidden" value="586546d5">
                    <input name="a3" type="hidden" value="13025">
                    <br clear="all">
                </td>
            </tr>
        </tbody>
    </table>
</div>
</body>
</html>

Is it possible to get value of input tag where name="a2" in ajax. // i.e we want value 586546d5 in the variable.

D3.js text element does not display unicode character correctly

I'm trying to append ➤ into SVG using unicode as seen below.

g.append("text")
        .attr("x", function(d) { return x(d.value) })
        .attr("y", 10)
        .attr("dy", ".55em")
        .attr("font-family", "FontAwesome")
        .text("&#10148;");

&#10148; is displayed, but not ➤

How to change the message in checkedmultiSelect widget in dojo?

Im using the dojo widget CheckedMultiSelect,how to change the message "0 items(s) selected".

var select =   new CheckedMultiSelect({
        dropDown: true,
        labelText: 'States',
        multiple: true,
        name: 'state',
        onChange: getValues,
        required: true
    }, "stateSelect");