3 * Shows only subset of divs with class "theme" which have class passed
6 function show_theme(version) {
7 if (version == "all") {
8 $$("div.theme").setStyle("display", "block");
11 $$("div.theme." + version).setStyle("display", "block");
12 $$("div.theme:not(." + version + ")").setStyle("display", "none");
15 /* Auto load blocks */
17 function theme_load() {
18 /* Is this document with themes? */
19 if ($$("div.theme").length == 0) return;
21 /* Do we have some parameter? */
22 if (self.document.location.hash.length < 1) return;
24 /* Is the parameter existing class for theme? */
25 var hash = self.document.location.hash.substring(1);
26 if ($$("div.theme." + hash).length==0) return;
28 /* Finally show chosen schema */
32 window.addEvent("domready", theme_load);
34 function fader_autoload() {
35 if ($("fader") == null) return;
37 var f = new Fader('fader');
41 window.addEvent('domready', fader_autoload);
45 if ($$("div.downloadbutton").length == 0) return;
46 var myTips = new Tips('div.downloadbutton');
47 $$("div.downloadbutton").store('tip:text', 'There are more download options available on the downloads page.');
50 window.addEvent("domready", dl_hint);
53 var dl_match = /https?:\/\/prdownloads\.sourceforge\.net\/phpmyadmin\/(.*)\?download.*/;
54 var notes_match = /https?:\/\/sourceforge\.net\/project\/shownotes.php\?release_id=([0-9]*)/
57 * Returns tracking string for the URL.
59 function get_track_string(href, rel) {
60 if (href.search(dl_match) != -1) {
61 if (rel == 'quick-download') {
62 pageTracker._trackPageview('/external/sf/quick-download/' + href.replace(dl_match, '$1'));
64 return '/external/sf/download/' + href.replace(dl_match, '$1');
66 if (href.search(notes_match) != -1) {
67 return '/external/sf/release-notes/' + href.replace(notes_match, '$1');
69 if (href.indexOf('/sourceforge.net/project/showfiles.php?group_id=23067') != -1) {
70 return '/external/sf/downloads';
72 if (href.indexOf('/sourceforge.net/services/project_services.php?project_id=23067&showListings=true') != -1) {
73 return '/external/sf/services';
75 if (href.indexOf('/sourceforge.net/donate/index.php?group_id=23067') != -1) {
76 return '/external/sf/donate';
78 if (href.indexOf('/sourceforge.net/news/?group_id=23067') != -1) {
79 return '/external/sf/news';
81 if (href.indexOf('/sourceforge.net/tracker/?atid=377408&group_id=23067') != -1) {
82 return '/external/sf/tracker/bugs';
84 if (href.indexOf('/sourceforge.net/tracker/?atid=377411&group_id=23067') != -1) {
85 return '/external/sf/tracker/features';
87 if (href.indexOf('/sourceforge.net/tracker/?atid=377410&group_id=23067') != -1) {
88 return '/external/sf/tracker/patches';
90 if (href.indexOf('/sourceforge.net/tracker/?atid=689412&group_id=23067') != -1) {
91 return '/external/sf/tracker/themes';
93 if (href.indexOf('/sourceforge.net/tracker/?atid=377409&group_id=23067') != -1) {
94 return '/external/sf/tracker/support';
96 if (href.indexOf('/sourceforge.net/tracker/?atid=387645&group_id=23067') != -1) {
97 return '/external/sf/tracker/translations';
99 if (href.indexOf('/sourceforge.net/forum/forum.php?forum_id=72909') != -1) {
100 return '/external/sf/forum/english';
102 if (href.indexOf('/sourceforge.net/forum/forum.php?forum_id=296543') != -1) {
103 return '/external/sf/forum/french';
105 if (href.indexOf('/sourceforge.net/forum/forum.php?forum_id=297172') != -1) {
106 return '/external/sf/forum/german';
108 if (href.indexOf('http://pma.cihar.com/') != -1) {
109 return '/external/demo/' + href.substr(21);
111 if (href.indexOf('http://cve.mitre.org/cgi-bin/cvename.cgi?name=') != -1) {
112 return '/external/cve/' + href.substr(46);
114 return '/external/' + href.replace('http://','').replace('https://','');
118 * Callback when user clicks on external link.
120 function onclick_callback(e) {
121 var href = this.get('href');
122 var rel = this.get('rel');
123 var track = get_track_string(href, rel);
124 pageTracker._trackPageview(track);
128 * Iinitalizes tracking for external links.
130 window.addEvent('domready',function(){
131 $$('a').each(function(anchor){
132 var href = anchor.get('href');
133 // if it matches my site or is an absolute path it's outgoing
135 && href.indexOf('http://www.phpmyadmin.net') == -1
136 && href.indexOf('http://phpmyadmin.net') == -1
137 && (href.indexOf('http://') != -1 || href.indexOf('https://') != -1)) {
138 anchor.addEvent('click', onclick_callback);