#StackBounty: #javascript #java #android #printing Android EPSON thermal Print data from web-view on click?

Bounty: 50

This is my Code here

Here In my activity I am using Epson SDK to print data form web-view to android activity..

So on Web-veiw Onclick It will start Printer Activity and It will print

What I am trying to do is….. OnClick from Web-view it will Open printer Activity so that it should print and Exit…

So here I have created a Web-view… With the help of JS it sill Open my activity form Web-view (onclick) till now its fine… But I tried to Add print and exit.. onclick but Its not working… Because I need to select language and Printer Model….

How ever in shared_DiscoveryActivity I am adding Printer and saved it in shared prefs… so it will not ask any more… its working

but In Main Activity I tried to remove buttons… But not wokring… I am getting Error (ERR_PARM) in printing… my code is fine..

Without Language and model no its not printing… I tried to give them in shared prefs but its not working…

Can any one help me to print the data OnClick from Web-view it will Open printer Activity so that it should print and Exit…

I have given my complete code.. if any ask me…
please suggest me on this kind plz…


In new update I have given my entire code from github with Web-view in assets folder…. Please suggest me on this kind

Update 1

Here In my Code I am struck here

mPrinter = new Printer(((SpnModelsItem) mSpnSeries.getSelectedItem()).getModelConstant(),
                               ((SpnModelsItem) mSpnLang.getSelectedItem()).getModelConstant(),

I am getting this at output for SpnModel , language and total mPrinter with both of them I tried same But I got this

    System.out:----- spnSeries -----android.widget.Spinner{24440249 VFED..C. ........ 0,444-466,516 #7f0e007b app:id/spnModel}
System.out: ----- lang -----android.widget.Spinner{1a6c617c VFED..C. ........ 0,604-366,676 #7f0e007d app:id/spnLang}
System.out: ----- printer -----com.epson.epos2.printer.Printer@b8250d6

System.out:----- spnSeries -----android.widget.Spinner{24440249 VFED..C. ........ 0,444-466,516 #7f0e007b app:id/spnModel}
System.out: ----- lang -----android.widget.Spinner{1a6c617c VFED..C. ........ 0,604-366,676 #7f0e007d app:id/spnLang}
System.out: ----- printer -----com.epson.epos2.printer.Printer@144a56f8

its Different always…

At initializeObject() in MainActivity… The Only thing is the if I overcome this manually or some other My printer is done.

On create only I am trying use runPrintReceiptSequence() But due to the above printer Language and Model selection I need to press a button.. I want to Do this without pressing a button or Do this language selection and Model selection from Shared Prefs… Like I have done adding Printer Discovery in shared_DiscoveryActivity.java

Please suggest me on this kind….

Get this bounty!!!

#StackBounty: #javascript #jquery #asp.net #clientpeoplepicker PeoplePicker not loading in a ASP.net page – SharePoint

Bounty: 50

I am able to load the peoplepicker control in a page created within SharePoint using the code below but the same when i try to load in a .net application, integrated in SharePoint then i am unable to get the desired result.

After checking multiple blogs I finally ended up using the below references :


and the code i use is :

function initializePeoplePicker() {

    // Create a schema to store picker properties, and set the properties.
    var schema = {};
    schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
    schema['SearchPrincipalSource'] = 15;
    schema['ResolvePrincipalSource'] = 15;
    schema['AllowMultipleValues'] = true;
    schema['MaximumEntitySuggestions'] = 50;
    schema['Width'] = '220px';

   this.SPClientPeoplePicker_InitStandaloneControlWrapper('peoplePickerDiv', null, schema);

I am able to see the desired results in a SharePoint webpart page as shown below :

but the moment i try to do the same in a asp.net project which is deployed as an app in SharePoint server then the code stops working.

NOT Working

I believe the issue is with the references but i tried numerous combinations but nothing worked. Kindly help.

Get this bounty!!!

#StackBounty: #javascript #jquery #jquery-ui #datepicker #jquery-ui-datepicker Jquery Datepicker select multiple date ranges in one cal…

Bounty: 50

My requirement is to allow user to select multiple date ranges in a single calendar, also previous date selections should not be allowed to change. How is this possible? Below is the code and link to fiddle


<input type="text" class="spromotion-input-inbody spromotion-input-datepick" id="sproid-bookingcondition-datefrom">
<input type="text" class="spromotion-input-inbody spromotion-input-datepick" id="sproid-bookingcondition-dateto">


$( function() {
    var dateFormat = "mm/dd/yy",
      from = $( "#sproid-bookingcondition-datefrom" )
          defaultDate: "+1w",
          changeMonth: true,
          numberOfMonths: 1
        .on( "change", function() {
          to.datepicker( "option", "minDate", getDate( this ) );
      to = $( "#sproid-bookingcondition-dateto" ).datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 1
      .on( "change", function() {
        from.datepicker( "option", "maxDate", getDate( this ) );

    function getDate( element ) {
      var date;
      try {
        date = $.datepicker.parseDate( dateFormat, element.value );
      } catch( error ) {
        date = null;

      return date;
  } );

Get this bounty!!!

#StackBounty: #javascript #layout #golden-layout Proper way to catch resize events for a pane in GoldenLayout

Bounty: 100

I want to taken an action in one pane (i.e. a container content item) when a resize event occurs (whether resizing the panes, the whole browser, or zoom). The below works, but… if I then drag around the panes, even go from left-right, to right-left, or top-bottom, it stops working.

I’m assuming re-arranging panes resets something, and there is a proper way to get a persistent event handler. But I cannot work it out from the docs.


function initPanes(){
    console.log("First pane resized");  //TEMP
    console.log("Second pane resized");  //TEMP

Get this bounty!!!

#StackBounty: #javascript #d3.js d3.js chemical tube bar chart

Bounty: 50

enter image description here

I am interested in creating this liquid bar chart of sorts. With the pointers/dotted markers pulling off to the side like shown.

latest bar chart code

latest cleaned up water wave code

//I want to strip down this waterwave code

//progress chart

latest base code for this bar chart.

var $this = $("#checmicalbars");

var data = [{
  "label": "Rendering",
  "value": 90,      
  "startcolor": "#c3da54",
  "endcolor": "#c1e500"
  "label": "Character Design",
  "value": 95,      
  "startcolor": "#e94adc",
  "endcolor": "#aae3dd"
  "label": "Sketching",
  "value": 80,      
  "startcolor": "#c3da54",
  "endcolor": "#fa5283"
  "label": "Story Boarding",
  "value": 90,      
  "startcolor": "#e94adc",
  "endcolor": "#f83b03"
  "label": "Drawing",
  "value": 82,      
  "startcolor": "#c3da54",
  "endcolor": "#f88504"
  "label": "Painting",
  "value": 90,      
  "startcolor": "#e94adc",
  "endcolor": "#f7d200"

var h = 150;
var w = 300;

    var options = {
  minlimit: 0,
  maxlimit: 100

// setup scales
var x = d3.scale.ordinal()
  .rangeRoundBands([0, w], .1);

var y = d3.scale.linear()
  .range([h, 0]);

var xAxis = d3.svg.axis()

var yAxis = d3.svg.axis()
// setup scales

// chart container
var progresschart = d3.select($this[0]).append("svg")
  .attr("width", w)
  .attr("height", h)
  .attr("transform", "translate(0,5)");

var barrectsholder = progresschart.append("g")
  .attr("class", "chart")
  .attr("transform", "translate(15,0)");
// chart container

y.domain([options["minlimit"], options["maxlimit"]]);

//__ bars
var bar = barrectsholder.selectAll("rect")

//__ enter
  .attr("class", "bar")
  .attr("y", h);

//__ update   
  .attr("y", h)
  .attr("height", 0)
  .style("fill", function(d){
    return d.startcolor;
  .style("fill", function(d){
    return d.endcolor;
  .attr("width", 20)
  .attr("x", function(d, i) {
    return 30 * i;
  .attr("y", function(d) {
    return y(d.value);
  .attr("height", function(d) {
    return h - y(d.value);

//__ exit
  .attr("y", 0)
  .attr("height", 0)
//__ bars

Get this bounty!!!

#StackBounty: #javascript #google-chrome #dom #javascript-events Find out what code triggered a change in input

Bounty: 50

I have Chrome auto password filling disabled.

In one particular login page of a website, right after the load event, the password input goes from being empty to have a string as its value (not reflected in the DOM). If I take a look through console.dir() I can read its value, and is a password I’ve never use or would use, so I never typed that. Nothing I’ve searched or asked has been of any help.

I’ve debugged the page and with an eventListener I can pinpoint the exact moment that value is introduced, just listening for the change event. But that is not really useful, I just see the input changed with that weird password but know nothing about why it’s appearing there. AFAIK the event object doesn’t have a clue of who’s behind the change.

I want to know what function or snippet or code is acting on that input and inserting that useless string.

How can I accomplish that?

EDIT: I appreciate the side help but I’m only really interested in the answer to the question asked

Get this bounty!!!

#StackBounty: #javascript #jquery Regex comma seperating thousands and keeping two decimals

Bounty: 50

I recently came up with this code while answering another StackOverflow question. Basically, on blur, this code will properly comma separate by thousands and leave the decimal at two digits (like how USD is written [7,745.56]).

I was wondering, is there a way to update the regex to accommodate for decimals as well as thousands, without doing the messy .toFixed(2). Especially, because I don’t need to display the decimals if no decimals are specified. Additionally, I would like to knock off any decimals passed 2 (even if that means ’rounding down’).

Input -> Target Output

7456 -> 7,456
45345 -> 45,345
25.23523534 -> 25.23
3333.239 -> 3,333.23
234.99 -> 234.99
2300.99 -> 2,300.99
23123123123.22 -> 23,123,123,123.22

Current Regex

var format = function (num) {
    return parseFloat(num).toFixed(2).replace(/B(?=(d{3})+(?!d))/g, ",")
$(function () {
    $("#principalAmtOut").blur(function (e) {
<input id="principalAmtOut" type="text" />

Get this bounty!!!

#StackBounty: #magento2 #javascript #performance #knockoutjs Magento 2: javascript elements load slowly

Bounty: 150

Checkout forms, gallery on product pages, and more elements loaded by javascript take up to 4 seconds to load.

What can be done to make javascript elements load faster?


I’m using a custom theme which inherits from Blank theme. I’ve not added additional JS files, only made minor changes to them for translation purposes.
All caches are enabled.
It is a live site in production mode.

Pages loading times:

Category and product pages: 5 to 6 seconds.
Cart and checkout: 9 to 10 seconds. (is it normal?)

On product pages, product images are the last to load. This can be annoying for the user. Is it possible to make them load faster / before other elements on the page?

product page
category page

Get this bounty!!!

#StackBounty: #magento2 #javascript #uicomponent #knockoutjs #requirejs Magento 2 : How to Detect Checkout Step Change

Bounty: 50

I am trying to figure out the best method of detecting a step change in Magento 2’s checkout. For example going from shipping details to payment, or vice versa.

I have done some digging and in vendor/magento/module-checkout/view/frontend/web/js/model/step-navigator.js I can use next() which fires on the continue button, and navigateTo() which fires when a user clicks on the checkoutstep directly – but both methods seem rather hacky, there must be a cleaner way to detect a step change regardless of how and which step.

I was hoping for a stepChange() function or something similar that fires whenever a checkout step change happens.

My question:

What is the best method to trigger my custom JS when a checkout step change occurs?

Get this bounty!!!

#StackBounty: #javascript #jquery #html #css #twitter-bootstrap-3 JQUERY.COUNTO.JS: On Scroll Count Numbers NOT OnLoad

Bounty: 50

I’m working with one page website and I want to add a counting numbers with it, so I use javascript.countTo.js. I created every section to group related data and I put the section counter <section id="counters"> below my portfolio section <section class="justaddheight portfolio">. Everytime the page load the number count and when I scroll I always see that numbers stop or ended it’s counting. Now, I want the number counts when I scroll and get into the section counter <section id="counters">. In addition, I used WOW.js and easingJS with my site, it’s the best if you combined the code with it, but it also acceptable if not. The code are the following below:


<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1"><!--The Viewport-->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!--Character Set-->
        <meta http-equiv="Cache-control" content="no-cache"> <!--The No-Cache-->

        <link rel="stylesheet" href="css/animate.min.css">
        <!-- Bootstrap -->
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <!-- Font-Awesome -->
        <link rel="stylesheet" href="css/font-awesome.min.css">
        <!-- Icomoon-->
        <link rel="stylesheet" href="css/icomoon.css">
        <!-- Simple Line Icons -->
        <link rel="stylesheet" href="css/simple-line-icons.css">     
        <!-- Fonts -->
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>


        <!-- jQuery -->
        <!-- Bootstrap -->
        <!-- Wow -->
        <!-- Counter -->
        <!--Custom JS-->
    <body id="top">
        <section class="justaddheight text-center about" >
            <h1>SCROLL DOWN</h1>
            <p>First, Scroll Now</p>
            <p>Second, try Again but wait for few seconds before scroll to identify.</p>
         <section class="justaddheight service">

         <section class="justaddheight portfolio">

        <section id="counters">
89 Finished projects
2343409 Templates
1302 Cup of coffees
52 Happy clients
</div> </div> </div> </section> </body> </html> <style type="text/css"> /* USE JUST TO ADJUST HEIGHT*/ .justaddheight{ height: 500px; } .text-center{ text-align: center; } </style> $('.counter-number').countTo();

Get this bounty!!!