« first day (2250 days earlier)   
00:00 - 11:0011:00 - 14:00

11:01 AM
This is why I hate borders, as humans we don't need them
<tbody>

    <span ng-repeat="item in metricsTableData">
    <tr>
        <td ng-class="nowrap"><input type="checkbox"></td>
        <td ng-class="nowrap"><button>+</button></td>
        <td ng-class="nowrap">{{item.beneficiary}}</td>
        <td class="align-right">{{item.paymentdate}}</td>
        <td class="align-right">{{item.currency}}</td>
        <td class="align-right">{{item.amount}}</td>
        <td class="align-right">{{item.tcount}}</td>
        <td class="align-right">{{item.account}}</td>
How to do that correctly in bootstrap ?
 
What's with the span?
 
Bootstrap :(
3
 
I dont know what else to put inside the tbody, I just want the 'tr' to be repeated for each item
@SvenvandeScheur I can feel your emotions :|
 
@rlemon: I'm gonna see if I can make that script of yours do rain too. The water level rising has to be tweaked then, though...
 
I love / hate Cordova, why in the world have cordova ecosystem not matured up like others and started using require. Some plugins soil the global object, others use require some fucking override global methods. And these are the official ones :/
I shall write a poem about Cordova, as a suicide note!
 
11:14 AM
@SvenvandeScheur Crap not in bootstrap , in angular lol
anyways I found a clue here johnculviner.com/…
 
@SvenvandeScheur Bullshiting CSS since 2011?
 
ffs ... time to cleanup tabs
 
@KarelG scrrenshot before you kill all
 
@FlyingGambit: Why do you have a span in a tbody?
 
Inline tables?
 
11:18 AM
why ss'ing ?
 
We can all compete
 
@Abhishrek Bootstrap, promoting bad practice since 2011...
 
i recall bootstrap being "the world most popular mobile first website"
keh
 
11:33 AM
Hiya
who's online ?
 
everybody
 
@CSᵠ I doubt that
 
By my estimate about 1 Billion people on the planet at the very least.
 
that's a very safe estimate
 
Math
 
11:37 AM
@Faiz99 Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
anyone know how to get the following event working with safari ?window.onbeforeunload = function (e) {
var e = e || window.event;

// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Any string';
}

// For Safari
return 'Any string';
};
 
@Derek Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
apologies
 
how does this works ? - zamzar.com/convert/svg-to-pdf
 
var e = e || window.event;

// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Any string';
}

// For Safari
return 'Any string';
};
Safari isnt detecting the event ot responding too it
do i need to do this in a different way?
 
11:40 AM
-1
A: Wrap a function around an async function to extract value and assign to global variable

Fabian ScheidtSure. Have a look at this fiddle. Does this work for you? https://jsfiddle.net/9djnexrv/ // Prices will be stored here var prices = []; // Dummy-function to mock async behaviour function callArgos(someString, someCallback) { setTimeout(function() { someCallback(someString, 42); }, Math...

What the fuck lol
 
@Derek What are you trying to do ? It's easy to detect window/page closing but you just can do about nothing at that time
 
Its not detecting window closing, its the browser leaving the current page.
 
doesn't matter, it's the same for your script, it dies before it can does anything persistent
 
in my page, there's the potential for the user to full out half of a form but then click back and lose it all.
 
@Mathematics They take a file, which you upload, then they convert it to another format and let you download it
 
11:43 AM
> // For IE and Firefox prior to version 4
wut
window.event is non standard btw
 
There's no need to test, you can both fill event.returnValue AND return the string
 
in chrome, it warns the user with a pop up message asking if they are sure they want to leave, works fine.. but safari doesnt work
 
More and more browsers are ignoring that, yes
And I expect that all will end up dropping the handling of that value
 
is there a differentw ay to do it?
 
It's bad practice to rely on that event
 
11:46 AM
@Derek check for onbeforeunload eg
!! mdn onbeforeunload
 
@KarelG Something went on fire; status 403
 
you can save whenever the form is filled, and restore/alert when the user comes back, for example
 
@Mathematics Either convert svg to bitmap and embed, or convert svg to pdf's build-in vector drawing commands.
 
I'd prefer a pop-up over that.
:34567426
If I want forms to be saved, I'll ask my browser to do it.
 
i took a wrong event
check this mdn page
 
11:48 AM
onbeforeunload doesnt work with safari
 
@rlemon doesn't matter. The point is you can't do anything on closing, but you can do something on arrival on a page (back, or another page of your site)
 
@Derek works since safari 3
 
Ahh!
Im testing thsi ona very old phone.
 
We always test on latest iOS. This way the client can't complain if they don't update
 
I need to find out what version of safari is on this phone.
 
11:50 AM
iPhone 1?? Safari 3 is from 2007
 
thanks guys
 
@rlemon I am pretty sure Safari 3 predates iPhone entirely
 
@rlemon Doubt the battery still works :p
 
Iphone C
i hate apple phones lol
 
Thats atleast Safari 6
 
11:51 AM
i dont own one.
 
Nor do I. We have company test phones. Anyway, iPhone 5C should support iOS 10.
 
Im using a test device, and its not working... sigh.
 
@Cerbrus was trying to make two rows repeat
@Derek me too bro ^_^
 
    :34566802 Found the right way

<tbody ng-repeat="item in metricsTableData">

    <tr>
        <td ng-class="nowrap"><input type="checkbox"></td>
        <td ng-class="nowrap"><button>+</button></td>
        <td ng-class="nowrap">{{item.beneficiary}}</td>
        <td class="align-right">{{item.paymentdate}}</td>
        <td class="align-right">{{item.currency}}</td>
        <td class="align-right">{{item.amount}}</td>
        <td class="align-right">{{item.tcount}}</td>
        <td class="align-right">{{item.account}}</td>
 
12:04 PM
That is not the "right" way IMO ;P
 
@OliverSalzburg I hope its not XD , was following this example jsbin.com/hefadifu/1/edit?html,js,output
Though I got the view as I wanted, however I can see multiple 'tbody' elements
 
In general, it's fine to have multiple tbody elements. It's just not necessary here
I assume you have not followed the link I just sent your way?
 
I didn't get any link today
oh sorry, I just saw it , there was no alert for it
@OliverSalzburg Thanks
 
Hello, i have a form which need to focus on next field on enter .
 <form id="valueForm" ng-submit="submitValues()">
    <div class="small-input list padding" style="padding-top:4px;">
      <div ng-repeat="item in inputs  track by $index">
        <label class="item item-input">
          <input type="text" placeholder="" ng-model="item.value" ng-disabled="item.ticked">
          <ion-checkbox ng-click="addField($index)" ng-change="saveValue(item.ticked,item.value,$index)" ng-model="item.ticked" ng-disabled="!item.value" style="border: none;padding-left: 30px;" class="checkbox-royal"></ion-
1
Q: Html form Change focus on enter

Suraz KhanalI am trying to change the focus on enter key on my html input form. I have to trigger saveValue() from input field while pressing enter and focus to next input field. I am trying with the directive from angularjs move focus to next control on enter but dont know how can i modify according to my n...

 
@OliverSalzburg Sweet, Got it working, Thanks
 
12:15 PM
You're welcome
@SurazKhanal I don't think you posted enough code to illustrate your problem
 
yap @OliverSalzburg but nothing happen
 
Need help installing OpenWRT
 
@Abhishrek First step, get a backup router ;P
 
My iPhone is a great backup Router
 
@OliverSalzburg there is link to my question. Could you help me?
 
12:19 PM
@Abhishrek Then what's the problem?
@SurazKhanal No and your question is bad
 
@OliverSalzburg My Router is not supported by OpenWRT
 
@Abhishrek So what's your plan then?
 
@OliverSalzburg I know that, I was thinking how technically they do it
maybe use jspdf etc.. etc..
 
@OliverSalzburg No idea
 
@Sheepy sooo confused with that
 
12:20 PM
@Abhishrek How about DD-WRT?
 
@Mathematics There are dozens of Webkit based renderers that export to PDF. That conversion is trivial
 
Ah, Oliver already helped
 
@OliverSalzburg on server side right ?
 
@Mathematics Sure
 
12:22 PM
@Abhishrek Then you're SOL, have a look at DD-wrt or tomato
 
@OliverSalzburg that's not so attractive
 
@Mathematics Well, that's their service, isn't it?
 
You want client-side conversion to PDF?
 
@Cerbrus and already tried jspdf and canvastoHtml etc...
 
12:24 PM
Client-side conversion to PDF: Ctrl+P
 
this looks good but not able to make it work locally
 
@BenFortune nope and nope
 
@OliverSalzburg not when you have a large chart and stupid clients :P
 
@Abhishrek Why not?
 
@Mathematics Actually, yeah, that's exactly when
 
12:25 PM
not supported :/
I'll just go ahead and buy a router from US
 
Support it!
 
on my way back
 
What router?
 
iBall Baton WRA150N
 
There's one for broadcom and atheros but can't remember what it's called
 
12:28 PM
@Abhishrek You don't have to go US for that, you should be able to buy that in your local market
 
@Abhishrek Apparently it's a rebranded TP-Link TP-WR741
 
@BenFortune that i didn't expect!
 
Don't know how reliable that info is
 
That website failed to load
 
The link doesn't work, but it has some info
 
12:31 PM
the xda forum might be inaccessible from your country
could read the post
 
xda forums are accessible
 
Finally XDA opened :S
My internet has been extremely spotty
Okay figured out the problem. Airtel DNS :/
they force updated my router settings again :| < Why I want to install OpenWRT
 
using it on mobile ?
 
Nope, I have a broadband connection with them. I usually use OpenDNS or Google DNS as DNS Servers
 
Does anyone have proper regex for removing trailing, beginning and doudble commas in JS ?
 
12:38 PM
1 message moved to Trash can
@Shashi Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
http://hastebin.com/imododijoc.js
how to replace commas properly with regex.
above is the function I am using so far but still left withno commas at all
 
@Shashi So, have you tried running only 1 replacement at a time?
To, like, find out which one of the 3 operations is actually causing the problem
 
@Shashi you want to replace all commas in a string ?
@Shashi I cant access that js page so I am guessing ^ thats your requirement.
 
gist: 6dfc686c11363965e41ee3e4c639cd92, 2016-12-13 12:45:37Z
comma_handler: function(rawString){
    commaProcessing1 =  rawString.replace(/^,/, '');
    commaProcessing2 =  commaProcessing1.replace(/,,/g, ',');
    return commaProcessing2.replace(/,(?=[^,]*$)/, '');
  }
here is the updated one
my requirements are to replace first character if it is comma with "nothing", then replace double comma with single comma and then last comma if there
@OliverSalzburg I guess multiple lines of this code is creating trouble not just one.
 I guess
    text.replace(/,(?=[^,]*$)/, '')
this is the problem
regex to replace comma at the end of string ?
Found the solution :) it was indeed this line
 
12:58 PM
function c(input) {
	return input.replace( /,,/g, "," )
  .replace(/^,/,"")
  .replace(/,$/,"");
}
How about that?
 
Can I chain replace as well ?
 
@Shashi Yes
It returns a string, so that has all the properties of the original input string
 
@OliverSalzburg I was not aware, thanks (y)
 
Note that this only replaces double comma. Meaning that ,,,, would be replaced with ,,
 
I guess I really need to lear regex.... I have been putting this in pending state from way too long :|
 
1:01 PM
why don't you clear the "," before and after first
 
I just came with this solution s.replace(/^,|,$/g, '').replace(/,,+/g, ',');
 
then check the text itself
 
not sure if its right
 
If you want to reduce any amount of consecutive commas to a single one, you need something else
 
@OliverSalzburg got it, my current state of code will not generate more than two commas!
 
1:12 PM
Hey guys
 
I'm not your guy, buddy
2
 
@Shashi add a + at the end it should work for any multiple , too
 
My post data is not being sent to my php script which uses header('Content-Type: application/json; charset=utf-8', true);
 
Can I use a any db on free heroku app?
 
@BenFortune I'm not your buddy, pal
 
1:14 PM
I'm not your pal, friend
 
Damn, what movie was that from?
 
South Park haha
 
Trolls 2
 
I am posting through ajax jquery, with dataType: 'json' in ajaxSetup
is it normal my post would not succeed?
 
Did you check the request in devtools?
 
1:16 PM
@MikeM. What are you using to get the data in PHP?
if it's $_POST, it's wrong.
 
it is $_POST
 
It's wrong.
 
Could you explain why it would be wrong, please?
 
That's just for URL encoded forms. You need to use something like file_get_contents('php://input')
 
ah the stdin?
 
1:21 PM
did anyone called me ?
 
Nope.
 
I don't get a response text, however I do send back text.
I do get an 200 html code...
 
You got errors turned on?
Nvm, 200, i'm going blind
 
:-)
 
What is the prototyping framework of choice these days?
 
1:26 PM
Define prototyping
 
Define the UI, define a bunch of animations (then hook the actual poc code somewhere on a button click)
 
@MikeM. ensure that you're submitting as POST and not GET
 
vanilla?
 
@BenFortune Side note, I do use json_encode on the php script.
 
Meh will take 30 centuries to get the CSS Right
 
1:27 PM
Learn CSS?
 
@KarelG type: "POST" is defined in the JQUERY AJAX call
 
@SvenvandeScheur I am proficient in CSS
 
@MikeM. You should be able to get your JSON using json_decode(file_get_contents('php://input'), true)
 
I have also spent months trying to get just the correct pixel accuracy, so I really don't see a point in doing it all over again :'(
 
And returning it, json_encode.
 
1:28 PM
probably I'll just use milligram
with jquery
 
Ah now I get it, forgot to refresh :P
 
do one pixel row matter?
 
Sorry @BenFortune
 
keh
 
@KarelG yes it does
 
1:29 PM
@Abhishrek, based on that message, I doubt if you are "proficient in CSS"...
 
Heh, np.
 
idgaf
 
@SvenvandeScheur He's smarter than you.
For sure.
 
Not saying smart here
Might be a brilliant dev for shure
Spendings month on CSS just seems very long to me...
 
not a single project duh
 
1:30 PM
Ah...
 
FML
 
Collectively I have spent less time writing JS more time fixing CSS
 
fml too
 
forgot that hashmap does not store all inputs in the right order. Was wasting time figuring out the bug
 
@KarelG FYL
also welcome to the club :D
 
1:31 PM
That why I don't like "frameworks" like bootstrap, they don't really help in speeding up things, just slow you down ;)
 
const lines = contents.split(/\r?\n/).filter(Coolean);
best typo I've done in a while
 
!!> JSON.stringify({ o: { a: { b: 3 } } }, null, 4)
 
@Abhishrek "{\"o\":{\"a\":{\"b\":3}}}"
 
:>
 
1:35 PM
@Abhishrek "{\n \"o\": {\n \"a\": {\n \"b\": 3\n }\n }\n}"
 
1:54 PM
i've never used those other parameters :P
 
morning cats
why doesn't javascript have any "smooth scrolling" functionality? Which facilities would be used to accomplish this? Do I have to do the math by hand? I suck at math
 
Define smooth scrolling?
like using a curve or something?
 
yeah, like using ease-in-sine or a cubic bezier
 
Have been learning CSS for over a decade. I must be a slow learner. Actually, there was a time when I think IE 6's CSS support is marvellous...
 
00:00 - 11:0011:00 - 14:00

« first day (2250 days earlier)