Link:
https://dannyman.toldme.com/2011/10/25/javascript-hack-hide-an-element-on-a-page/
JIRA is an issue tracking system that is really flexible, but sometimes presents irritatingly arbitrary limitations.
I have been working on a screen which uses multiple tabs. The tabs are there to make it easier for the user to find the fields they want to edit, without scrolling through a single long, complex issue. But every tab has a Comment field rendered on it, which makes things confusing, and makes each tab look like it needs scrolling.
So, just remove the Comment field from the Screen, right? No, it isn’t in there. So, can I remove Comment via the Field Configuration Scheme? No, it is mandatory. Damn your arbitrary limitation, JIRA!
Anyway, I don’t normally speak JavaScript, but I managed to gin up the following snippet to paste into a Field description which appears in the screen I wanted to tweak. It finds the element containing the Comment, and sets its style display attribute to none
. As the page loads, the Comment box is rendered, but once the page load completes, the Comment box disappears.
<script type="text/javascript">
function hideCommentField() {
var elements = document.getElementsByClassName('field-group aui-field-wikiedit');
elements[0].style.display = 'none';
}
// http://stackoverflow.com/questions/807878/javascript-that-executes-after-page-load
if(window.attachEvent) {
window.attachEvent('onload', hideCommentField);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function() {
curronload();
hideCommentField();
};
window.onload = newonload;
} else {
window.onload = hideCommentField;
}
}
</script> |
<script type="text/javascript">
function hideCommentField() {
var elements = document.getElementsByClassName('field-group aui-field-wikiedit');
elements[0].style.display = 'none';
}
// http://stackoverflow.com/questions/807878/javascript-that-executes-after-page-load
if(window.attachEvent) {
window.attachEvent('onload', hideCommentField);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function() {
curronload();
hideCommentField();
};
window.onload = newonload;
} else {
window.onload = hideCommentField;
}
}
</script>
It is ugly, but effective. Also, it is helpful for me to learn JavaScript!
PS: Thanks for the Guidance, Ed Burns!
1 Comment
Link:
https://dannyman.toldme.com/2011/10/21/yahoo-urls-cafe/
It is a little thrill to query Google Maps for “yahoo urls” — URLs is the name of one of their cafeterias, where I am right now for a Meetup.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/10/11/cloudflare-free-cdn/
What it is: a free CDN!
What is a CDN? A Content Delivery Network is a service that caches parts of your web site at different points around the world. This makes your web site load faster in foreign countries, and it reduces load on your server, which is really useful if there’s a traffic spike.
Why is it free? Apparently, they started as a honey pot. A honey pot is a trap where you leave something sweet out for spammers and hackers, who will come and try to taste your honey. The honey pot keeps track of where the bad guys are coming from and what techniques they are using, and this data is then analysed to improve security. They also have a bunch of apps they can sell you, and honestly when you’re looking for a paid service for your company, the first thing that will come to mind is the service you already use for your personal stuff.
I personally have never set up a CDN before, but it has always sounded like a pain in the rear. So, I was pleased to see that Cloudflare made it braindead simple: they did a pretty good job of guessing out the contents of my DNS zone file, which I was later allowed to upload in full, then a quick update of my registrar’s NS records and yes, I was using Cloudflare inside of 5 minutes.
How does it work? It basically replaces your world-facing, web-serving A records with its own IPs, which it then answers HTTP/1.1 style. If you need dedicated IPs for SSL, that costs money. You set some A records to go straight to your server, so you can, for example, use SSH. It hands out the same IPs around the world, then magic network routing that I haven’t learned about takes care of the rest.
You're sharing IPs now, so HTTP/1.1 will work fine, but you'll need to set aside an A record if you need direct access.
Configure your A records: orange clouds will be fronted by CloudFlare, grey clouds will go straight home.
So, is it faster? Results from just-ping.com look very promising. I see an average latency of 62ms for CloudFlare versus an average latency of 144ms for direct access to my server in Chicago.
An interesting aside, here’s a bit of the just-ping.com output for CloudFlare:
Mumbai, India: Okay 64.1 64.5 67.4 173.245.60.121
Chicago, U.S.A.: Okay 0.3 0.5 1.4 173.245.60.121
Nagano, Japan: Okay 5.5 5.7 6.1 173.245.60.121
. . .
Lisbon, Portugal: Okay 58.8 59.1 59.4 173.245.60.121
Chicago, U.S.A.: Okay 1.8 2.3 2.7 173.245.60.44
Dallas, U.S.A.: Okay 1.4 1.6 1.7 173.245.60.44
And for my direct IP:
Mumbai, India: Okay 286.8 288.1 293.1 173.203.101.184
Chicago, U.S.A.: Okay 1.9 2.0 2.5 173.203.101.184
Nagano, Japan: Okay 165.8 165.9 166.1 173.203.101.184
. . .
Lisbon, Portugal: Okay 151.1 152.7 153.6 173.203.101.184
Chicago, U.S.A.: Okay 0.2 0.3 0.5 173.203.101.184
Dallas, U.S.A.: Okay 25.3 25.5 25.9 173.203.101.184
This shows two things. First, CloudFlare thoroughly reduces my latency anywhere outside Chicago. Second, and really just interesting for the biggest nerds, just-ping’s first Chicago node is closer to CloudFlare’s Chicago node, and just-ping’s second Chicago node is closer to my RackSpace-hosted Chicago node.
Okay, what about actual page-loading time? Well, I just happened to be doing some basic latency testing last month. Here’s what page load looked like in Google Chrome then:
Google Chrome's Developer Tool Network view last month.
Here’s what a page load from California looks like just now:
Page load time from California with CloudFlare enabled.
So, a basic test shows that the initial round trips go from 275ms to 136ms, and the total page load time is reduced by about 1/3. Now, the difference between 750ms and 500ms isn’t a huge deal, but the second you step overseas it makes a big difference. Above you see that the latency from my server in Chicago to Lison is 150ms, and 165ms to Nagano, and 290ms to Mumbai. With the latency goggles cranked to 200ms my page load times went from .75s to nearly 2s. So, my web site feelsfelt sluggish for people in Europe or Japan, and frustratingly slow in India. CloudFlare removes that frustration. Now, Mumbai can browse my site as comfortably as I could from California the day before. (Mumbai should be even faster once Cloudflare adds a node in India.)
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/10/08/hack/
Enjoying Dmitri Samarov‘s new novel about driving a taxi in Chicago, I looked up at my cafe table in Mountain View, CA and noted that mine was the only analog screen. Technologist that I am, I’m just not ready for an e-reader yet. I’m too attached to hardbacks and paperbacks.
My mother, however, has a Nook. She used to drive a cab in Chicago.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/10/06/rip-steve-jobs/
. . . and thanks for all the fonts!
You will be missed, even by us non-Apple-fanboys.
UPDATE: Glenn Kelman has written the most eloquent words I have read that explain why Steve was an inspiration:
Many eulogies celebrate Steve in terms of his “products” — those mass-produced little gadgets that we love for letting us check email in front of our friends — and lose sight of his grass-strained spirit. What always moved me about Steve was the calligraphy and the LSD, the passage to India and his firing from Apple, his struggles at NeXT and his return from the wilderness.
The insistence on Steve’s perfection, on the vast difference between him as a producer and us as consumers, seems inhuman and even lonely to me. I wish we could take a moment in eulogizing Steve to grieve for him as one frail human to another, and feel in his passing the miracle of every human life; so many other people, geniuses on a smaller scale, are struggling his struggle. It hurts me that we have so much love to give to Steve and not to them.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/09/28/orthodontia-for-america/
At the beginning of our current economic crisis, I embarked on an infrastructure project to make needed improvements to my existing jaw line, and to stimulate the economy through orthodontic stimulus spending. This spending was completely paid for by my personal revenues, and did not contribute to any deficit spending on my part. At least three orthodontic professionals, one oral surgeon, one x-ray technician, and countless support staff received their paychecks as a result of this infrastructure program.
This morning, we took the scaffolding off to unveil my new and improved smile.
The economy could use a little more stimulating, though. With any luck I can make a contribution to consumer confidence by smiling at people.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/09/23/high-plains-couch-potato/
Watching "High Plains Drifter" via Amazon.com on the Roku, and on the laptop. On the one hand, the laptop can do high definition. On the other hand, it has to sit on my belly.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/09/19/gag-me-quickster/
Left a comment on the Official Netflix blog:
What I have always liked about Netflix is that it was a one-stop shop that knew what kind of movies I like to watch, and could make smart suggestions. Netflix had a huge selection and could send me just about any movie I could want. The streaming was a nice addition, but you lose a lot of control that you have on the DVDs like selecting aspect ratios or subtitles. Sometimes the instant gratification is nice but what was important wasn’t a red envelope versus a streaming video, it was that one way or another, Netflix would get me movies I wanted to see.
Then you decided that what I really wanted had little to do with movies or brand loyalty and everything to do with having a medium preference shoved down my throat.
If the streaming is such a fundamentally new business model start a new business and be done with it. Call it Streamstr. Partner with old-fogey Netflix and their stupid red envelopes so their retarded users can stream a few videos. Better yet, be the Netflix I knew and loved so many years: deliver movies I want to me. If I have to pay more for postage or more for some streaming movie that is really “hot” that is totally cool.
But what you are doing right now is some sort of bizarre unsettling brand seppuku. Why is such a great company working so hard to come up with new and innovative ways to scare away its loyal customers?
Netflix used to be about people watching movies. End of story. Movies. Movies. Movies. Its not about picking the winner between VHS and Beta, its about your customers and their love of movies and about your love of getting the movies to your customers. No nonsense, no bull, no false choices. And now? You’re tossing that advantage aside, and I am just as well served by your competitors.
Making the experience more complex for your customers is just plain dumb. =(
Good luck with your brave new spin-off model. It was a nice ride while it lasted.
-danny
37.3861606-122.0853371
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/08/25/steve-jobs-is-a-wise-man/
Personally, I am not fond of Apple products, but I can not help but admire Steve Jobs. I am enjoying a compendium of Steve Jobs quotes from the Wall Street Journal. This one hits close to home:
“The cure for Apple is not cost-cutting. The cure for Apple is to innovate its way out of its current predicament.”
I work for an Information Technology bellwether, which is both highly profitable and obsessive over maintaining its profit margins. Costs must always be contained. While we have a variety of interesting technology we are working to develop, we are presently completing our latest round of workforce reductions. I wish our leadership could be a little more like Steve Jobs:
“This is not a one-man show. What’s reinvigorating this company is two things: One, there’s a lot of really talented people in this company who listened to the world tell them they were losers for a couple of years, and some of them were on the verge of starting to believe it themselves. But they’re not losers. What they didn’t have was a good set of coaches, a good plan. A good senior management team. But they have that now.”
You know what John Chambers might say to that?
“The problem with the Internet startup craze isn’t that too many people are starting companies; it’s that too many people aren’t sticking with it. That’s somewhat understandable, because there are many moments that are filled with despair and agony, when you have to fire people and cancel things and deal with very difficult situations. That’s when you find out who you are and what your values are.”
Really, the whole collection is worth a read.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/08/17/ticket-or-gtfo/
I do not know the provenance of the source material, and can make no claims of intellectual property rights here. TinEye finds 550 similar images.
2 Comments
Link:
https://dannyman.toldme.com/2011/08/09/oh-netflix/
Netflix has two awesome distinctive features going for it:
- It knows my taste enough to effectively recommend content.
- They do streaming and DVDs!
Right now I watch old TV shows on the streaming service, and maybe 1 DVD/month. For this I pay $10/month. That’s a good deal.
But now they want to cleave their business between DVD operations and streaming, and charge most customers more. Plenty of folks have gotten upset over this. Personally, I am irritated that they’re screwing the pooch on one of their distinctive features. What I had perceived as “hey, in order to satisfy our customers, we do DVDs and now we do streaming” now sounds more like “we want to be a streaming company but shipping DVDs is so expensive so we need to separate these different operations to keep the DVD taint off our streaming business!”
Which makes their distinctive feature list look like this:
- It knows my taste enough to effectively recommend content.
They do streaming OR they do DVDs.(Oh wait, that’s nothing special!)
Amazon.com offers me a bunch of “free” streaming through Prime and newer TV shows a la carte. I can get DVDs from the local library, not to mention any number of commercial outlets. I don’t need Netflix for only one or the other.
For my existing plan of 1 DVD at a time plus unlimited streaming, I pay $10/month. The new price for this same plan is to become $16/month. That’s a 60% increase.
I could go unlimited streaming only for $8/month. There goes the $2 extra I had been paying to watch the occasional DVD.
They do have a limited DVD plan for $5/month, but I called and confirmed that I can not combine that plan with unlimited streaming. That’s too bad, because $8 for unlimited streaming plus a few dollars more for limited DVDs is basically what I want.
So, for now, I am downgrading to their $5/month limited DVD plan. If Netflix wants to be a streaming-only provider they need to have way better streaming content. If Netflix wants to stick with their original plan of providing entertainment I like at an affordable price via the most cost-effective delivery option, then I look forward to signing up for an unlimited streaming plus limited DVD plan.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/07/29/shoot-yourself-in-the-face/
From frumforum.com via jsonp.cc:
House Republicans could have kept the debt ceiling issue wholly separate from the budget cut issue.
Instead, Republicans put the gun on the table. They raised the menace of deliberate default in a way it has not been raised before.
Then, having issued the threat, they discovered that their own core supporters would not allow the gun to be holstered again.
They issued demands they knew could not be met, for budget cuts much bigger than Republicans ever enacted when they had the power to enact them. They cocked the weapon. And now here we are: the demands are unmet and Republicans find themselves facing a horrible choice between yielding on their exorbitant demands or pushing the United States into financial upheaval.
David Frum was a speechwriter for President George W Bush.
Feedback Welcome
Link:
https://dannyman.toldme.com/2011/07/26/the-debt-limits-you/
Some article in The Atlantic about how President Obama has decided to stop being the reasonable guy who makes every last concession imaginable and then some and as of last night is now playing Chicken with the Republicans, daring them to screw the country over, since they’re likely to take the greater share of the blame. Yeah, anyway, this part got me laughing:
There’s an old Soviet joke that a friend once told me. An old man has been standing in line for bread for eight hours. His feet hurt, his back hurts, and he is faint from hunger. Finally, finally the door opens and the baker comes out. He starts to salivate. He fingers the rubles in his pocket.
“Comrades, go home,” says the baker. “There is no flour to make bread today.”
Something in the old man snaps. He has been waiting in these lines for decades, and he has had enough. “This is ridiculous!” he shouts. “I fought in the Great Patriotic War! I worked for forty years in the factory! Now you make me wait in line for eight hours when there’s no flour? You didn’t know this eight hours ago? I spit on you, and I spit on the regime!” And he spits in front of the baker.
A man steps out of line behind him. “Careful, comrade. You know how it would have been in the old days if you had said these things.” With his thumb and forefinger, he mimes a gun being fired at the temple.
Defeated, the man steps out of line and trudges home with everyone else. He goes into his apartment and sits down at the table. His wife walks in just as he pours the last of his vodka into a glass, and drinks it down in one gulp.
“Sergei, what’s wrong?!” she cries, seeing the look on his face. “Don’t tell me they’re out of bread!”
“It’s worse than that. Much worse.” he says heavily.
“What could be worse?”
“They’re out of bullets.”
Americans should maybe be stocking up on their dark humor.
Feedback Welcome