« first day (642 days earlier)      last day (4311 days later) » 

9:02 PM
@Steven10172 You might want to test that theory in all browsers. Even if the spec guarantees one comes before the other (I don't know that it does), not everybody will necessarily follow it to the letter.
 
I just need to run the onChange() event when there is a change to the field, but it can't run as they type. It can only run after the box losses focus
 
Oh, right. Yes, you are correct in that.
 
I originally thought it would do update per key stroke
but sure why I thought that, but i did
 
Not unreasonable. It's just not really changed until you're finished editing.
 
This sucks. Since I have a layover of elements, it keeps trying to go to the original spot of the element in the background
So i'm not sure how to keep the focus
I tried e.focus() and it works, but if you hit tab it focuses on the box u just finished
Any ideas on how to fix that?
 
9:11 PM
Wouldn't it solve everything to just rely on onChange?
onchange sorry
That way you're not bugging the server about an unchanged field as well.
 
I have onchange, but updateserver() submits a hidden form to a J2EE application and the application then focuses on that field in the background
and at the end of the onchange I can do this.focus(); but if they were to hit tab it wouldn't keep them in the next box
 
Well whatever happens after the server update will just undo whatever you set at onchange. Not sure what you mean by 'background field.'
Ideally you'd have a callback in the ajax function handling the update.
 
I can't edit any of that
This is all UpdateServer() does:
function updateServer(e) {
var hiddenForm = getHiddenForm();
var inputs = hiddenForm.elements;
inputs.namedItem("changedcomponentid").value = e.name;
inputs.namedItem("changedcomponentvalue").value = e.value;
inputs.namedItem("event").value = "X"; //Send a Dummy Event so the script see's its invalid and sets the right Event
console.log("changedcomponentid::"+ e.name + " changedcomponentvalue::"+ e.value);
submitHidden();
setTimeout(function(){showUpdate();}, 500);
 
So what you need to do is use a focus handler on that hidden input or whatever that gets focused.
document.getElementById('inputID').onfocus = function(){
//set focus on tab you want
}
 
After submitHidden() is complete it focuses on e.name;
 
9:20 PM
Or you might just have to set the tabindex in the HTML unless you know for certain the J2EE app is injecting a script or something.
Sorry, bad syntax on that.
 
I'll just do:
document.getElementById(e.name).onfocus( function(){
e.id;
} )
in updateServer
still doesn't solve the issue about if they hit tab
cause they'll no longer be on e.id; they'll be on the input box below
 
e.target refers to the element being hit with an event.
And don't assume name and id will work interchangeably but you don't need that anyway.
e.target.onfocus = function(e){

}
This is what you want. I was in JQuery/addEventListener mode earlier.
 
well I have the layover have e.name as the id of the field it's changing in the background
 
Okay, focus happens in submitHidden or in that setTimeout callback because that will likely nuke whatever happens in submitHidden if it also focuses somewhere.
 
Well when u load the page it auto focus on a field and when u submit something it focuses back on that field, so idk what to do anymore
so I'll just make it re-focus on the field you just changed
unless I can do onchange="if(key==tab){ focusNextField(); }"
 
9:31 PM
Oh this is a regular full page load submit.
 
Is that possible. Can I read the keypress for an onchange event?
 
Everything happens after the keypress so I don't think it would help you. What matters is figuring out in which function that focus is happening.
 
That focus is happening internally in the J2EE application
 
anyknow where i can snag a base64 encoder for javascript
 
J2EE can't initiate focus from the back end. It has to initiate JS to do it.
I googled the last time I was looking for one. Came up right away IIRC.
@ert3 ^
 
9:37 PM
Well I can't find the function that does it. There is over 100js files each over 5000lines long for this application. And I can't edit any of that code. I must write code on top of it
 
@ert3 what's wrong with window.btoa ?
 
well im running a small ajax form for HTTP authentication
 
assuming a reasonable browser, of course ;-)
 
Yes, but you need to identify what fires it. Is it in or chaining from that setTimeout function or it is in or chaining from that submitHidden?
 
9:38 PM
window.btoa is a base64 encoder. If it's not in your browser it's easy to find a shim for it.
 
wow I need to learn up in java script
 
chains from submithidden
submithidden calls sendhiddenform that sends an event to the j2ee application and then the focus happens somewhere on the response from the server
 
Now you do or don't control submitHidden? Because that half-second timeout is complete BS. There's no guarantee the server might not hang for half a second.
At some point you should have some kind of interface that lets you drop a callback that fires when that server update is done.
For now, if it's working that way, you could refocus in the setTimeout function but you're asking for trouble if you don't use a callback when you can explicitly be certain the update is done.
 
I can only call submitHidden(); I can't edit it
I can edit nothing that is built with/for the application. I can only add my own js files on top of it that run as a Bookmarklet
 
thanks guys, window.btoa easy enough to use and works just fine in firefox awesome
 
9:48 PM
Then what you need to do is set onfocus on all of those hidden inputs and find a way to examine them and dynamically refocus to the next thing you would want tabbed to, whenever they are focused on. Mostly, though, I would recommend burning any framework to the ground that dumps 100 js files on you.
 
@Alnitak I always wondered what it stands for
 
btoa?
 
why cannot it be sensible base64encode and base64decode or something
b to a
 
binary to ascii
 
I see
 
9:49 PM
i.e. 8-bit to < 8-bits
 
it's very C-like
like atoi and itoa
but ascii uses 7 bits and base64 only 6
 
yeah, dunno why they did call it that, though. it's not intuitive
 
@ErikReppen It's an IBM application
 
WebSphere?
 
It cost Millions.... :/
 
9:50 PM
you can't use all 128 of the 7 bit range
 
Maximo
 
WebSphere.
 
so they stick to 64 "safe" characters
 
Maximo? Jesus H are they con artists.
 
Maximo (MRO) - Wikipedia, the free encyclopedia
en.wikipedia.org/wiki/Maximo_(MRO)IBM Maximo Asset Management software provides asset lifecycle and maintenance management for all asset types on a single platform
It tells the maintenance people what they need to do and stores parts they've used
 
9:52 PM
Oh, okay. So you're trying tweak the application via front end bootstrapping with a bookmarklet. You're not actually using a framrework to build somthing.
 
Nope. I'm just making a bookmarklet to make things easier for the 10,000+ people who use it
 
I'll tell you what's unintuitive though. .slice vs .substr vs .substring
 
And every time i turn around the application is being difficult
 
Alright, so only worry about focus hitting those hidden inputs. And yes 100 js files (they're not even combined in the final product?) is horrible.
The API for navigating HTML is node-based.
 
There are ~20 on the page I'm working on, but that is 1 small section of the application
there are different ones for each page
 
9:54 PM
Right, but if there's a pattern you could potentially dynamically scoot to the next tab.
^ in the HTML structure.
Do you have chrome or Firefox with firebug?
Just wondering if you can actually inspect the HTML easily.
 
I have chrome
 
So right-click on a field. Click inspect element.
 
I've been doing that
pastebin.com/BE5UfCzE <-- I'll do that to make sure the server doesn't hiccup
 
Okay, if you're tabbing through inputs, I'm guessing they're in a list or a table or something?
Like UL/LI or TR/TD
 
in a table, is there a focusnext() function? Cause if so I can get it to work
tr/td
 
10:00 PM
I don't think so but you could use the DOM API to move up the node tree to get to the TD that the inputs are sitting in and then scoot to the next TD and throw focus at the input in there.
 
I'll just set tabbable="true" and use dojo to search for that
since dojo is the built in library instead of jQuery...
 
Not sure what's getting tabbable set to true. Never used Dojo.
Do the hidden inputs have a class name that's common?
Or is it always one text input and one hidden after that?
 
There is 1 hidden form and it stores the info like the id of updated field and value, and when its submitted it changes those values on the page
 
No class= attribute on the hidden inputs? No pattern of text input followed by hidden input?
 
on the page there is 100's of boxes when u type and blur it sends data to hidden and submits the hidden, then the server gets the response and updates the input box to see if it was valid
I put a layover on the page so you no longer see any of that, you only see the layover that manipulates those 100 boxes as the users only want to see 8 Key input boxes that they'll use and it'll increase efficiency as they don't need to scroll up and down to find them
I'll just use dojo.query("table[id='nwo_table'] tr td input"); to cycle through the fields and set focus to the next field
I'll use:
var tmpArray = dojo.query("table[id='nwo_table'] tr td input");
for(var i=0;i<tmpArray.length;i++){ if(tmpArray[i].id == "nwo_asset") { tmpArray[i+1].id; } }
 
10:21 PM
so trying to make an HTTP login via java script, using this code pastebin.com/4fF1CQpr it wont redirect, as as far as i can tell its not authenticating as it should
 
@Steven10172
Okay. Something like this:

dojo.query('#nwo_table tr td input[type=hidden]')[0].onfocus( function(e){
var thisLevel = e.target;
while(!thisLevel.nodeName.match(/td/i) ){ thisLevel = e.target.parentNode; }
var nextText = thisLevel.nextSibling.getElementsByTagName('input')[0];
nextText.focus(); //assumes text inputs are the first one in HTML
} );
 
the hidden isn't in the table
var hiddenForm = getHiddenForm();
var inputs = hiddenForm.elements;
inputs.namedItem("changedcomponentid").value = e.name;
inputs.namedItem("changedcomponentvalue").value = e.value;
inputs.namedItem("event").value = "X"; //Send a Dummy Event so the script see's its invalid and sets the right Event
console.log("changedcomponentid::"+ e.name + " changedcomponentvalue::"+ e.value);
submitHidden();
that is how i set the hidden
 
Wow. That's so stupid it makes my teeth hurt.
Not what you did to handle it. Their approach to it.
What I especially don't get is why they felt the need to set focus on a hidden element that's not even in the same section of HTML.
 
I got it working
 
Nice. Sorry, I misunderstood the HTML scenario.
 
10:31 PM
I did the tmpArray thing, it works. I just need to add the pastebin.com/BE5UfCzE to deal with server latency
even though there shouldn't be any I have 150mb/s down for external sites and 500mb/s down if its internal. and the application is internal
 
I can't believe I B freaking M engineers used a setTimeout to wait for an ajax update to happen.
 
This is how their input boxes look
<input id="mx1293" class="fld text" ctype="textbox" li="mx1294" maxlength="254" style="width: 300px; " async="1" ae="setvalue" type="text" title="Classification" value="" ov="" work="1" fldinfo="{&quot;saindex&quot;:&quot;2&quot;,&quot;length&quot;:&quot;254&quot;,&‌​quot;inttype&quot;:&quot;0&quot;,&quot;afindex&quot;:&quot;0&quot;,&quot;eventpri‌​ority&quot;:1}" originalvalue="">
and the hardest part is that the id"mx####" changes with every page view so it's not a simple grab by id anymore
 
Yeah, but at least it matches with the other input I'm assuming.
 
yea, I would crawl and do like input #1, but the engineers change that often. So I have to search by the title
function getInputIdByTitle(title, num) { if(!num) { num = 0; } console.log('getInputIdByTitle('+title+')['+num+']'); return dojo.query('input[title^="'+title+'"]').attr('id')[num].toString(); }
its soo stupid, can't believe ibm made this application
 
Looks like an awful lot of working stupid. They must be doing the offshoring of 10,000 barely code literate engineers approach. That would explain the constant changes.
 
10:38 PM
the old version used to be like this: new_checkbox_6_box
and the number changed, but it was static
 
Whoever wrote that knew how to actually manage data on the front end most likely.
 
But the old system doesn't work in anything but IE
It won't let me login if I use Chrome/Firefox
 
0
Q: How to implement a Vector2D class in an Entity System?

BaneThis is a followup to this question, which I answered, but this one tackles with a much more specific subject. This answer helped me understand Entity Systems even better than the article. I've read the (yes, the) article about Entity Systems, and it told me the following: Entities are just a...

 
so I have to use javascript to get the DOM
to see what changed between versions
 
10:55 PM
@Steven10172 IE 8 and below pretty much use their own hosed version of the DOM API. The most common stuff like the basic get functions for grabbing HTML are the same but IE basically ignored most of the DOM API spec for 10 years.
 
in IE doesn't show generated html. only the original
 
What every JS/UI front end developer has known since at least like 2005 is that you write your code for the browsers that actually adhere to the spec first and then IE.
 
Well IE is standard browser here, so I have to make it work there, but the JS has no problem
 
That's kind of weird. I'm not sure what they would be screwing up there. But events in IE are different so maybe that was triggering off of something.
Please tell me everybody can at least use something other than IE if they want to.
 
u have 0 admin rights to install other browsers
but u can use chrome since it installs in the app data folder
but its technically not allowed, and help desk wont help if ur using it and half of internal applications dont work
 
11:00 PM
That's an ignorant IT dept.
 
no, its called a pharma company with 80,000+ employees and contacts with microsoft
and dell
 
And who selected the internal apps that only work in IE?
 
idk
IE is business standard
 
That's changing. Even MS finally acknowledged they had stop screwing around and got IE9 mostly caught up on the stuff they'd been lagging on for 10 years. Of course now there's all the new stuff they'll lag on for the next 10 years but the speed tests were what finally scared them I think.
 
My upload speed is low
generally its 50mb/s
Here we go
 
11:07 PM
Nice.
 
11:52 PM
0
Q: Posting a link to our page on facebook doesn't resolve correctly within FB

David ParksWe have a product page, there is a javascript popup that requires users to enter an email address to gain access. But the page behind the popup is fully rendered (for SEO value and such). https://www.frugg.com/bags/deal/32/coach-hot-lime-summer-bag But when I try to share this page in facebook ...

 

« first day (642 days earlier)      last day (4311 days later) »