Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turning off tabs view 1

Status
Not open for further replies.

berkshirea

Technical User
Mar 22, 2009
97
GB
Hi guys,

My apologies if this is not the appropriate forum for this question.

Can I ask for your advice? I want to see all of the contents of the tabs 'Profitability, Growth, Cash Flow, Financial Health, Efficiency Ratios' readily shown and without having to click each tabs to see its contents. Is there anyway in Javascript settings in the browser or anything I need to do to achieve that?


Thanks for any advice.
 
Are you an administrator for this site, trying to add/change functionality of your site; or are you an "end user" trying to modify your personal view of the site? Either way, I'm certain it can be done with javascript, but the method to get there would be vastly different ;)

I hope this helps;
robherc
 
hi robherc.sorry i was not very clear in my post. i am an end user of the site and i would like to just view those tabbed contents all at once. thanks for any suggestions.
 
Hi

To display all Key Ratios tabs one under the other, there is no need for JavaScript. A user stylesheet can solve it :
CSS:
@namespace url([URL unfurl="true"]http://www.w3.org/1999/xhtml);[/URL]

@-moz-document domain("financials.morningstar.com") {

div[teal].tab_content[/teal] [teal]{[/teal]
  [COLOR=coral]display:[/color] [COLOR=darkgoldenrod]block[/color] ![COLOR=darkgoldenrod]important[/color];
  [COLOR=coral]clear:[/color] [COLOR=darkgoldenrod]both[/color];
  [COLOR=coral]float:[/color] [COLOR=darkgoldenrod]none[/color] ![COLOR=darkgoldenrod]important[/color];
[teal]}[/teal]

div[teal].tab_content[/teal][teal]::[/teal]before [teal]{[/teal]
  [COLOR=coral]content:[/color] [COLOR=darkgoldenrod]attr[/color]([COLOR=darkgoldenrod]id[/color]);
  [COLOR=coral]display:[/color] [COLOR=darkgoldenrod]block[/color];
  [COLOR=coral]color:[/color] [COLOR=darkgoldenrod]white[/color];
  [COLOR=coral]background-color:[/color] [COLOR=darkgoldenrod]gray[/color];
  [COLOR=coral]padding:[/color] [COLOR=darkgoldenrod].25em[/color];
  [COLOR=coral]margin-top:[/color] [COLOR=darkgoldenrod]2.5em[/color];
  [COLOR=coral]clear:[/color] [COLOR=darkgoldenrod]both[/color] ![COLOR=darkgoldenrod]important[/color];
[teal]}[/teal]

div[teal].tab_content[/teal] table [teal]{[/teal]
  [COLOR=coral]float:[/color] [COLOR=darkgoldenrod]none[/color] ![COLOR=darkgoldenrod]important[/color];
[teal]}[/teal]

}
Tested in FireFox with Stylish. If you intend to use it in other browser or with other extension and experience problems, give us the details.

Of course, this can be implemented as user script too, in which case you can have nicer subtitles then the currently used [tt]id[/tt]s.

Feherke.
[link feherke.github.com/][/url]
 
you could just turn off css in your browser. then all the tables would show on one page.

or write a javascript applet that would (i) create another tab; (ii) copy the contents of the tabs in which you are interested; (iii) add the copied content into the new tab.

something like this perhaps

Code:
javascript[COLOR=#990000]:([/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color] [COLOR=#FF0000]{[/color] [b][COLOR=#0000FF]var[/color][/b] mytabs [COLOR=#990000]=[/color] [COLOR=#990000][[/color][COLOR=#FF0000]'profitability'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'growth'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'cashflow'[/color][COLOR=#990000],[/color][COLOR=#FF0000]'financial'[/color][COLOR=#990000],[/color][COLOR=#FF0000]'efficiency'[/color][COLOR=#990000]];[/color] [i][COLOR=#9A1900]/* add new tab */[/color][/i][b][COLOR=#0000FF]var[/color][/b] tabBar [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#keyStatWrap ul.in_tabs'[/color][COLOR=#990000]);[/color][b][COLOR=#0000FF]var[/color][/b] nli [COLOR=#990000]=[/color] $[COLOR=#990000]([/color]tabBar[COLOR=#990000]).[/color][b][COLOR=#000000]find[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'li:last'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]clone[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000]);[/color]nli[COLOR=#990000].[/color][b][COLOR=#000000]find[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'a'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]attr[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'href'[/color][COLOR=#990000],[/color][COLOR=#FF0000]'#tab-aggregate'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]text[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'Aggregate'[/color][COLOR=#990000]);[/color] nli[COLOR=#990000].[/color][b][COLOR=#000000]insertAfter[/color][/b][COLOR=#990000]([/color] $[COLOR=#990000]([/color]tabBar[COLOR=#990000]).[/color][b][COLOR=#000000]find[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'li:last'[/color][COLOR=#990000])[/color] [COLOR=#990000])[/color] [COLOR=#990000];[/color][i][COLOR=#9A1900]/* create new tab */[/color][/i][b][COLOR=#0000FF]var[/color][/b] newTab [COLOR=#990000]=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color] [COLOR=#990000]+[/color] mytabs[COLOR=#990000][[/color]mytabs[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]]).[/color][b][COLOR=#000000]clone[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000]);[/color]newTab[COLOR=#990000].[/color][b][COLOR=#000000]attr[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'id'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'tab-aggregate'[/color][COLOR=#990000]);[/color][i][COLOR=#9A1900]/* get content of existing tabs */[/color][/i][b][COLOR=#0000FF]var[/color][/b] content [COLOR=#990000]=[/color] [COLOR=#FF0000]''[/color][COLOR=#990000];[/color][b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]0[/color][COLOR=#990000];[/color] i [COLOR=#990000]<[/color] mytabs[COLOR=#990000].[/color]length[COLOR=#990000];[/color] i[COLOR=#990000]++)[/color][COLOR=#FF0000]{[/color]  content [COLOR=#990000]+=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color] [COLOR=#990000]+[/color] mytabs[COLOR=#990000][[/color]i[COLOR=#990000]]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]();[/color][COLOR=#FF0000]}[/color][i][COLOR=#9A1900]/* add content into new tab */[/color][/i]newTab[COLOR=#990000].[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color] content [COLOR=#990000]);[/color][i][COLOR=#9A1900]/* insert new tab into dom */[/color][/i]newTab[COLOR=#990000].[/color][b][COLOR=#000000]insertAfter[/color][/b][COLOR=#990000]([/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color] [COLOR=#990000]+[/color] mytabs[COLOR=#990000][[/color]mytabs[COLOR=#990000].[/color]length [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000]])[/color] [COLOR=#990000]);[/color][i][COLOR=#9A1900]/* alert the user */[/color][/i][b][COLOR=#000000]alert[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]'finished'[/color][COLOR=#990000]);[/color][COLOR=#FF0000]}[/color][COLOR=#990000])();[/color][b][COLOR=#000000]void[/color][/b][COLOR=#990000]([/color][COLOR=#993399]0[/color][COLOR=#990000]);[/color]

to use the above, create a new bookmark and copy/paste the above code into the location of the bookmark. call it whatever you like. then when you browse to the page you want aggregated, click on the bookmark link and a new tab called 'aggregate' will be created with the content of the other tabs within.

or you can simplify the above and just dump all the content into the first tab. slightly shorter that way.
Code:
javascript[COLOR=#990000]:([/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color] [COLOR=#FF0000]{[/color][b][COLOR=#0000FF]var[/color][/b] mytabs [COLOR=#990000]=[/color] [COLOR=#990000][[/color][COLOR=#FF0000]'profitability'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'growth'[/color][COLOR=#990000],[/color] [COLOR=#FF0000]'cashflow'[/color][COLOR=#990000],[/color][COLOR=#FF0000]'financial'[/color][COLOR=#990000],[/color][COLOR=#FF0000]'efficiency'[/color][COLOR=#990000]];[/color][b][COLOR=#0000FF]for[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]var[/color][/b] i [COLOR=#990000]=[/color] [COLOR=#993399]1[/color][COLOR=#990000];[/color] i [COLOR=#990000]<[/color] mytabs[COLOR=#990000].[/color]length[COLOR=#990000];[/color] i[COLOR=#990000]++)[/color][COLOR=#FF0000]{[/color] content [COLOR=#990000]+=[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color][COLOR=#990000]+[/color]mytabs[COLOR=#990000][[/color]i[COLOR=#990000]]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]();[/color] [COLOR=#FF0000]}[/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color][COLOR=#990000]+[/color]mytabs[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]([/color] $[COLOR=#990000]([/color][COLOR=#FF0000]'#tab-'[/color] [COLOR=#990000]+[/color] mytabs[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]]).[/color][b][COLOR=#000000]html[/color][/b][COLOR=#990000]()[/color] [COLOR=#990000]+[/color] content[COLOR=#990000]);[/color][COLOR=#FF0000]}[/color][COLOR=#990000])();[/color][b][COLOR=#000000]void[/color][/b][COLOR=#990000]([/color][COLOR=#993399]0[/color][COLOR=#990000]);[/color]
 
as it happens, pressing the export button dumps out a csv of all the information too.

so you could get a spreadsheet directly (which may what you intend long term).

or use the csv via javascript to produce quick and nicely formatted tables as an alternative to aggregating the existing tables. (probably not as efficient as browser side processing though).

or if you want a direct link for download without going to the page, this will work:


(assuming you have permission to deep link)
 
wow, thanks very much jpadie and feherke.

@jpadie, i've been using the export csv thingy but noticed lately that rows in it are not the same as before, but the page is still showing all the rows i had set up on my spreadsheet.

@feherke, that's awesome! it worked like magic!

have a nice day guys and thanks very much!
 
so if what you want is a csv output from the page, that is also generatable via javascript from the page.
 
so if what you want is a csv output from the page, that is also generatable via javascript from the page. "

hi jpadie, how to i get the csv output from the page?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top