|
11 | 11 | $extra = null; |
12 | 12 | $experimental = false; |
13 | 13 | $show_title = true; |
| 14 | +$css_files = ['transvision.css']; |
| 15 | +$js_files = ['/js/base.js']; |
14 | 16 |
|
15 | 17 | switch ($url['path']) { |
16 | 18 | case '/': |
17 | 19 | $controller = 'mainsearch'; |
18 | 20 | $show_title = false; |
| 21 | + $js_files[] = '/js/component_filter.js'; |
| 22 | + $js_files[] = '/js/main_search.js'; |
| 23 | + $js_files[] = '/js/sorttable.js'; |
| 24 | + $js_files[] = '/assets/jQuery-Autocomplete/dist/jquery.autocomplete.min.js'; |
19 | 25 | break; |
20 | 26 | case '3locales': |
21 | 27 | $controller = 'mainsearch'; |
22 | 28 | $show_title = true; |
23 | 29 | $page_title = '3 locales search'; |
24 | 30 | $page_descr = 'One source locale, get search results for two target locales'; |
| 31 | + $js_files[] = '/js/component_filter.js'; |
| 32 | + $js_files[] = '/js/main_search.js'; |
| 33 | + $js_files[] = '/js/sorttable.js'; |
| 34 | + $js_files[] = '/assets/jQuery-Autocomplete/dist/jquery.autocomplete.min.js'; |
25 | 35 | break; |
26 | 36 | case 'accesskeys': |
27 | | - $view = 'accesskeys'; |
| 37 | + $view = 'accesskeys'; |
28 | 38 | $page_title = 'Access Keys'; |
29 | 39 | $page_descr = 'Check your access keys.'; |
| 40 | + $js_files[] = '/js/sorttable.js'; |
30 | 41 | break; |
31 | 42 | case Strings::StartsWith($url['path'], 'api'): |
32 | 43 | $controller = 'api'; |
33 | 44 | $page_title = 'API response'; |
34 | 45 | $page_descr = ''; |
35 | | - $template = false; |
| 46 | + $template = false; |
36 | 47 | break; |
37 | 48 | case 'channelcomparison': |
38 | 49 | $controller = 'channelcomparison'; |
39 | 50 | $page_title = 'Channel Comparison'; |
40 | 51 | $page_descr = 'Compare strings from channel to channel.'; |
| 52 | + $js_files[] = '/js/select_column.js'; |
| 53 | + $js_files[] = '/js/sorttable.js'; |
41 | 54 | break; |
42 | 55 | case 'consistency': |
43 | 56 | $experimental = true; |
44 | | - $controller = 'consistency'; |
45 | | - $page_title = 'Translation Consistency'; |
46 | | - $page_descr = 'Analyze translation consistency across repositories.'; |
| 57 | + $controller = 'consistency'; |
| 58 | + $page_title = 'Translation Consistency'; |
| 59 | + $page_descr = 'Analyze translation consistency across repositories.'; |
47 | 60 | break; |
48 | 61 | case 'credits': |
49 | | - $view = 'credits'; |
| 62 | + $view = 'credits'; |
50 | 63 | $page_title = 'Credits'; |
51 | 64 | $page_descr = ''; |
52 | 65 | break; |
53 | 66 | case 'downloads': |
54 | | - $controller = 'tmx_downloads'; |
55 | | - $page_title = 'TMX Download'; |
56 | | - $page_descr = 'Create and download your own <abbr title="Translation Memory eXchange">TMX</abbr> file containing the strings you need.'; |
57 | | - $css_include = ['tmx.css']; |
| 67 | + $controller = 'tmx_downloads'; |
| 68 | + $page_title = 'TMX Download'; |
| 69 | + $page_descr = 'Create and download your own <abbr title="Translation Memory eXchange">TMX</abbr> file containing the strings you need.'; |
| 70 | + $css_files[] = 'tmx.css'; |
| 71 | + $js_files[] = '/js/select_all.js'; |
58 | 72 | break; |
59 | 73 | case 'gaia': |
60 | | - $view = 'gaia'; |
| 74 | + $view = 'gaia'; |
61 | 75 | $page_title = 'Gaia Comparison'; |
62 | 76 | $page_descr = 'Check the Status of your GAIA strings across repositories.'; |
63 | 77 | break; |
64 | 78 | case 'news': |
65 | | - $controller = 'changelog'; |
66 | | - $page_title = 'Transvision News and Release Notes'; |
67 | | - $page_descr = ''; |
68 | | - $css_include = ['changelog.css']; |
| 79 | + $controller = 'changelog'; |
| 80 | + $page_title = 'Transvision News and Release Notes'; |
| 81 | + $page_descr = ''; |
| 82 | + $css_files[] = 'changelog.css'; |
69 | 83 | break; |
70 | 84 | case 'productization': |
71 | | - $view = 'productization'; |
72 | | - $page_title = 'Productization Overview'; |
73 | | - $page_descr = 'Show productization aspects for this locale.'; |
74 | | - $css_include = ['productization.css']; |
| 85 | + $view = 'productization'; |
| 86 | + $page_title = 'Productization Overview'; |
| 87 | + $page_descr = 'Show productization aspects for this locale.'; |
| 88 | + $css_files[] = 'productization.css'; |
75 | 89 | break; |
76 | 90 | case 'rss': |
77 | 91 | $controller = 'changelog'; |
78 | | - $template = false; |
| 92 | + $template = false; |
79 | 93 | break; |
80 | 94 | case 'showrepos': |
81 | 95 | $experimental = true; |
82 | | - $controller = 'health_status'; |
83 | | - $page_title = 'Health status'; |
84 | | - $page_descr = 'Check the health status of locales.'; |
85 | | - $css_include = ['health.css']; |
| 96 | + $controller = 'health_status'; |
| 97 | + $page_title = 'Health status'; |
| 98 | + $page_descr = 'Check the health status of locales.'; |
| 99 | + $css_files[] = 'health.css'; |
| 100 | + $js_files[] = '/js/show_hide_tabs.js'; |
86 | 101 | break; |
87 | 102 | case 'stats': |
88 | 103 | $controller = 'showrepos'; |
89 | 104 | $page_title = 'Status Overview'; |
90 | 105 | $page_descr = 'Repository status overview.'; |
| 106 | + $js_files[] = '/js/sorttable.js'; |
91 | 107 | break; |
92 | 108 | case 'string': |
93 | 109 | $controller = 'onestring'; |
|
98 | 114 | $controller = 'unchanged_strings'; |
99 | 115 | $page_title = 'Unchanged Strings'; |
100 | 116 | $page_descr = 'Display a list of strings identical to English'; |
| 117 | + $js_files[] = '/js/component_filter.js'; |
| 118 | + $js_files[] = '/js/sorttable.js'; |
101 | 119 | break; |
102 | 120 | case 'unlocalized': |
103 | 121 | $experimental = true; |
104 | 122 | $controller = 'unlocalized_words'; |
105 | 123 | $page_title = 'Commonly Unlocalized Words'; |
106 | 124 | $page_descr = 'Display the list of the most common untranslated words. Click on the table headers to sort results.'; |
| 125 | + $js_files[] = '/js/sorttable.js'; |
107 | 126 | break; |
108 | 127 | case 'unlocalized-json': |
109 | 128 | $controller = 'unlocalized_words'; |
|
113 | 132 | $controller = 'check_variables'; |
114 | 133 | $page_title = 'Variables Overview'; |
115 | 134 | $page_descr = 'Show potential errors related to missing or mispelled variables in your strings.'; |
| 135 | + $js_files[] = '/js/component_filter.js'; |
| 136 | + $js_files[] = '/js/sorttable.js'; |
116 | 137 | break; |
117 | 138 | default: |
118 | | - $view = '404'; |
| 139 | + $view = '404'; |
119 | 140 | $page_title = '404: Page Not Found'; |
120 | 141 | $page_descr = ''; |
121 | 142 | break; |
|
148 | 169 | $content = ob_get_contents(); |
149 | 170 | ob_end_clean(); |
150 | 171 | } |
| 172 | + |
151 | 173 | ob_start(); |
| 174 | + |
152 | 175 | // Log script performance in the HTTP headers sent to the browser |
153 | 176 | Utils::addPerformancesHTTPHeader(); |
154 | 177 | $perf_header = ob_get_contents(); |
| 178 | + |
155 | 179 | // Log script performance in PHP integrated developement server console |
156 | 180 | Utils::logScriptPerformances(); |
| 181 | + |
157 | 182 | ob_end_clean(); |
| 183 | + |
158 | 184 | print $perf_header . $content; |
| 185 | + |
159 | 186 | die; |
0 commit comments