Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

static-elements.xsl 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:dt="http://xsltsl.org/date-time"
  5. xmlns:weekdays="."
  6. xmlns:months="."
  7. xmlns:str='http://xsltsl.org/string'
  8. exclude-result-prefixes="dt weekdays months">
  9. <xsl:import href="string.xsl" />
  10. <xsl:output method="xml" encoding="utf-8" indent="yes" />
  11. <xsl:template name="donate-link">
  12. <!--<xsl:element name="a">
  13. <xsl:attribute name="href" > -->
  14. </xsl:template>
  15. <xsl:template name="subscribe-nl">
  16. <form id="formnl" name="formnl" method="post" action="http://mail.fsfeurope.org/mailman/subscribe/newsletter-en">
  17. <p>
  18. <select id="language" name="language" onchange="var form = document.getElementById('formnl'); var sel=document.getElementById('language'); form.action='http://mail.fsfeurope.org/mailman/subscribe/newsletter-'+sel.options[sel.options.selectedIndex].value">
  19. <option value="en" selected="selected">English</option>
  20. <option value="el">Ελληνικά</option>
  21. <option value="es">Español</option>
  22. <option value="de">Deutsch</option>
  23. <option value="fr">Français</option>
  24. <option value="it">Italiano</option>
  25. <option value="nl">Nederlands</option>
  26. <option value="pt">Português</option>
  27. <option value="ru">Русский</option>
  28. <option value="sv">Svenska</option>
  29. </select>
  30. <input id="email" name="email" type="email" placeholder="email address" />
  31. <xsl:call-template name="subscribe-button" />
  32. </p>
  33. </form>
  34. </xsl:template>
  35. <!--generate subscribe button in correct language-->
  36. <xsl:template name="subscribe-button">
  37. <xsl:variable name="submit">
  38. <xsl:call-template name="gettext">
  39. <xsl:with-param name="id" select="'subscribe'" />
  40. </xsl:call-template>
  41. </xsl:variable>
  42. <xsl:element name="input">
  43. <xsl:attribute name="id">submit</xsl:attribute>
  44. <xsl:attribute name="type">submit</xsl:attribute>
  45. <xsl:attribute name="value">
  46. <xsl:choose>
  47. <xsl:when test="$submit != ''">
  48. <xsl:value-of select="$submit" />
  49. </xsl:when>
  50. <xsl:otherwise>
  51. <xsl:text>Submit</xsl:text>
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. </xsl:attribute>
  55. </xsl:element>
  56. </xsl:template>
  57. <!-- auto generate ID for headings if doesn't already exist -->
  58. <xsl:template name="generate-id">
  59. <xsl:copy>
  60. <xsl:choose>
  61. <xsl:when test="not(@id)">
  62. <!-- replace spaces with dashes -->
  63. <xsl:variable name="punctuation">.,:;!?&#160;&quot;'()[]&lt;&gt;>{}</xsl:variable>
  64. <xsl:variable name="formattedTitle1" select="translate(normalize-space(translate(.,$punctuation,' ')),' ','-')"/>
  65. <xsl:variable name="accents">áàâäéèêëíìîïóòôöúùûü</xsl:variable>
  66. <xsl:variable name="noaccents">aaaaeeeeiiiioooouuuu</xsl:variable>
  67. <xsl:variable name="formattedTitle2">
  68. <xsl:call-template name="str:to-lower">
  69. <xsl:with-param name="text" select="translate($formattedTitle1,$accents,$noaccents)" />
  70. </xsl:call-template>
  71. </xsl:variable>
  72. <xsl:attribute name="id">
  73. <xsl:value-of select="concat('id-',$formattedTitle2)" />
  74. </xsl:attribute>
  75. </xsl:when>
  76. <xsl:otherwise>
  77. <xsl:attribute name="id">
  78. <xsl:value-of select="@id" />
  79. </xsl:attribute>
  80. </xsl:otherwise>
  81. </xsl:choose>
  82. <xsl:if test="@class">
  83. <xsl:attribute name="class">
  84. <xsl:value-of select="@class" />
  85. </xsl:attribute>
  86. </xsl:if>
  87. <xsl:apply-templates select="node()"/>
  88. </xsl:copy>
  89. </xsl:template>
  90. <xsl:template name="support-portal-javascript">
  91. <script type="text/javascript">
  92. /* <![CDATA[ */
  93. function map_json_to_html(data) {
  94. for (x in data) {
  95. $(x).html(data[x]);
  96. }
  97. }
  98. $(document).ready(function() {
  99. var secret = window.location.search.slice(1);
  100. if (secret.length == 32) {
  101. $.getJSON('portal-backend?'+secret, function(data) {
  102. $("#support_portal_loading").hide();
  103. $("#support_portal").show();
  104. if (data.error) {
  105. $("#support_portal").html(data.error);
  106. } else {
  107. map_json_to_html(data);
  108. }
  109. });
  110. } else {
  111. $("#support_portal_loading").html("Expected parameter not found, nothing to show here.");
  112. }
  113. });
  114. /* ]]> */
  115. </script>
  116. </xsl:template>
  117. <xsl:template name="support-form-javascript">
  118. <script type="text/javascript" src="/scripts/jquery.validate.min.js"></script>
  119. <script type="text/javascript">
  120. /* <![CDATA[ */
  121. $(document).ready(function() {
  122. $("input[name=ref_url]").val(document.referrer);
  123. $("input[name=ref_id]").val(window.location.search.slice(1));
  124. $("form.support").validate({
  125. rules: {
  126. email: {email: true, required: true},
  127. country_code: {required: true}
  128. },
  129. submitHandler: function(form) {
  130. /* stop form from submitting normally */
  131. event.preventDefault();
  132. var $submitbutton = $("form.support input[type='submit']");
  133. $submitbutton.val($submitbutton.attr("data-loading-text"))
  134. /* Send the data using post and put the results in a div */
  135. var $form = $("form.support");
  136. $.post($form.attr("action"), $form.serialize(),
  137. function(data) {
  138. $("#support_form").fadeOut();
  139. $("#introduction").append('<div id="support_form_sent">'+data+'</div>');
  140. piwikTracker.trackGoal(2); // logs a conversion for goal 2
  141. }
  142. );
  143. }
  144. });
  145. });
  146. /* ]]> */
  147. </script>
  148. </xsl:template>
  149. <!-- refactored these her from the support form -->
  150. <xsl:template name="country-list-europe">
  151. <option value="AL">Albania (Shqipëria)</option>
  152. <option value="AD">Andorra</option>
  153. <option value="AT">Austria (Österreich)</option>
  154. <option value="BY">Belarus (Белару́сь)</option>
  155. <option value="BE">Belgium (België)</option>
  156. <option value="BA">Bosnia and Herzegovina (Bosna i Hercegovina)</option>
  157. <option value="BG">Bulgaria (България)</option>
  158. <option value="HR">Croatia (Hrvatska)</option>
  159. <option value="CZ">Czech Republic (Česko)</option>
  160. <option value="DK">Denmark (Danmark)</option>
  161. <option value="EE">Estonia (Eesti)</option>
  162. <option value="FO">Faroe Islands</option>
  163. <option value="FI">Finland (Suomi)</option>
  164. <option value="FR">France</option>
  165. <option value="DE">Germany (Deutschland)</option>
  166. <option value="GI">Gibraltar</option>
  167. <option value="GR">Greece (Ελλάς)</option>
  168. <option value="GL">Greenland</option>
  169. <option value="HU">Hungary (Magyarország)</option>
  170. <option value="IS">Iceland (Ísland)</option>
  171. <option value="IE">Ireland</option>
  172. <option value="IT">Italy (Italia)</option>
  173. <option value="LI">Liechtenstein</option>
  174. <option value="LT">Lithuania (Lietuva)</option>
  175. <option value="LU">Luxembourg (Lëtzebuerg)</option>
  176. <option value="MK">Macedonia [FYROM] (Македонија)</option>
  177. <option value="MT">Malta</option>
  178. <option value="MD">Moldova</option>
  179. <option value="MC">Monaco</option>
  180. <option value="ME">Montenegro (Црна Гора)</option>
  181. <option value="NL">Netherlands (Nederland)</option>
  182. <option value="NO">Norway (Norge)</option>
  183. <option value="PL">Poland (Polska)</option>
  184. <option value="PT">Portugal</option>
  185. <option value="RO">Romania (România)</option>
  186. <option value="RU">Russia (Россия)</option>
  187. <option value="SM">San Marino</option>
  188. <option value="RS">Serbia (Србија)</option>
  189. <option value="SK">Slovakia (Slovensko)</option>
  190. <option value="SI">Slovenia (Slovenija)</option>
  191. <option value="ES">Spain (España)</option>
  192. <option value="SE">Sweden (Sverige)</option>
  193. <option value="CH">Switzerland (Schweiz)</option>
  194. <option value="TR">Turkey (Türkiye)</option>
  195. <option value="UA">Ukraine (Україна)</option>
  196. <option value="GB">United Kingdom</option>
  197. <option value="VA">Vatican City (Città del Vaticano)</option>
  198. </xsl:template>
  199. <xsl:template name="country-list-other-continents">
  200. <option value="AF">Afghanistan (‫افغانستان‬‎)</option>
  201. <option value="AX">Åland Islands</option>
  202. <option value="DZ">Algeria (‫الجزائر‬‎)</option>
  203. <option value="AS">American Samoa</option>
  204. <option value="AO">Angola</option>
  205. <option value="AI">Anguilla</option>
  206. <option value="AQ">Antarctica</option>
  207. <option value="AG">Antigua and Barbuda</option>
  208. <option value="AR">Argentina</option>
  209. <option value="AM">Armenia (Հայաստան)</option>
  210. <option value="AW">Aruba</option>
  211. <option value="AU">Australia</option>
  212. <option value="AZ">Azerbaijan (Azərbaycan)</option>
  213. <option value="BS">Bahamas</option>
  214. <option value="BH">Bahrain (‫البحرين‬‎)</option>
  215. <option value="BD">Bangladesh (বাংলাদেশ)</option>
  216. <option value="BB">Barbados</option>
  217. <option value="BZ">Belize</option>
  218. <option value="BJ">Benin (Bénin)</option>
  219. <option value="BM">Bermuda</option>
  220. <option value="BT">Bhutan (འབྲུག་ཡུལ)</option>
  221. <option value="BO">Bolivia</option>
  222. <option value="BW">Botswana</option>
  223. <option value="BV">Bouvet Island</option>
  224. <option value="BR">Brazil (Brasil)</option>
  225. <option value="IO">British Indian Ocean Territory</option>
  226. <option value="VG">British Virgin Islands</option>
  227. <option value="BN">Brunei (Brunei Darussalam)</option>
  228. <option value="BF">Burkina Faso</option>
  229. <option value="BI">Burundi (Uburundi)</option>
  230. <option value="KH">Cambodia (Kampuchea)</option>
  231. <option value="CM">Cameroon (Cameroun)</option>
  232. <option value="CA">Canada</option>
  233. <option value="CV">Cape Verde (Cabo Verde)</option>
  234. <option value="KY">Cayman Islands</option>
  235. <option value="CF">Central African Republic (République Centrafricaine)</option>
  236. <option value="TD">Chad (Tchad)</option>
  237. <option value="CL">Chile</option>
  238. <option value="CN">China (中国)</option>
  239. <option value="CX">Christmas Island</option>
  240. <option value="CC">Cocos [Keeling] Islands</option>
  241. <option value="CO">Colombia</option>
  242. <option value="KM">Comoros (Comores)</option>
  243. <option value="CD">Congo [DRC]</option>
  244. <option value="CG">Congo [Republic]</option>
  245. <option value="CK">Cook Islands</option>
  246. <option value="CR">Costa Rica</option>
  247. <option value="CI">Côte d’Ivoire</option>
  248. <option value="CU">Cuba</option>
  249. <option value="CY">Cyprus (Κυπρος)</option>
  250. <option value="DJ">Djibouti</option>
  251. <option value="DM">Dominica</option>
  252. <option value="DO">Dominican Republic</option>
  253. <option value="EC">Ecuador</option>
  254. <option value="EG">Egypt (‫مصر‬‎)</option>
  255. <option value="SV">El Salvador</option>
  256. <option value="GQ">Equatorial Guinea (Guinea Ecuatorial)</option>
  257. <option value="ER">Eritrea (Ertra)</option>
  258. <option value="ET">Ethiopia (Ityop&#39;iya)</option>
  259. <option value="FK">Falkland Islands [Islas Malvinas]</option>
  260. <option value="FJ">Fiji</option>
  261. <option value="GF">French Guiana</option>
  262. <option value="PF">French Polynesia</option>
  263. <option value="TF">French Southern Territories</option>
  264. <option value="GA">Gabon</option>
  265. <option value="GM">Gambia</option>
  266. <option value="GE">Georgia (საქართველო)</option>
  267. <option value="GH">Ghana</option>
  268. <option value="GD">Grenada</option>
  269. <option value="GP">Guadeloupe</option>
  270. <option value="GU">Guam</option>
  271. <option value="GT">Guatemala</option>
  272. <option value="GG">Guernsey</option>
  273. <option value="GN">Guinea (Guinée)</option>
  274. <option value="GW">Guinea-Bissau (Guiné-Bissau)</option>
  275. <option value="GY">Guyana</option>
  276. <option value="HT">Haiti (Haïti)</option>
  277. <option value="HM">Heard Island and McDonald Islands</option>
  278. <option value="HN">Honduras</option>
  279. <option value="HK">Hong Kong</option>
  280. <option value="IN">India</option>
  281. <option value="ID">Indonesia</option>
  282. <option value="IR">Iran (‫ایران‬‎)</option>
  283. <option value="IQ">Iraq (‫العراق‬‎)</option>
  284. <option value="IM">Isle of Man</option>
  285. <option value="IL">Israel (‫ישראל‬‎)</option>
  286. <option value="JM">Jamaica</option>
  287. <option value="JP">Japan (日本)</option>
  288. <option value="JE">Jersey</option>
  289. <option value="JO">Jordan (‫الاردن‬‎)</option>
  290. <option value="KZ">Kazakhstan (Қазақстан)</option>
  291. <option value="KE">Kenya</option>
  292. <option value="KI">Kiribati</option>
  293. <option value="KW">Kuwait (‫الكويت‬‎)</option>
  294. <option value="KG">Kyrgyzstan (Кыргызстан)</option>
  295. <option value="LA">Laos (ນລາວ)</option>
  296. <option value="LV">Latvia (Latvija)</option>
  297. <option value="LB">Lebanon (‫لبنان‬‎)</option>
  298. <option value="LS">Lesotho</option>
  299. <option value="LR">Liberia</option>
  300. <option value="LY">Libya (‫ليبيا‬‎)</option>
  301. <option value="MO">Macau</option>
  302. <option value="MG">Madagascar (Madagasikara)</option>
  303. <option value="MW">Malawi</option>
  304. <option value="MY">Malaysia</option>
  305. <option value="MV">Maldives (‫ގުޖޭއްރާ ޔާއްރިހޫމްޖ‬‎)</option>
  306. <option value="ML">Mali</option>
  307. <option value="MH">Marshall Islands</option>
  308. <option value="MQ">Martinique</option>
  309. <option value="MR">Mauritania (‫موريتانيا‬‎)</option>
  310. <option value="MU">Mauritius</option>
  311. <option value="YT">Mayotte</option>
  312. <option value="MX">Mexico (México)</option>
  313. <option value="FM">Micronesia</option>
  314. <option value="MN">Mongolia (Монгол Улс)</option>
  315. <option value="MS">Montserrat</option>
  316. <option value="MA">Morocco (‫المغرب‬‎)</option>
  317. <option value="MZ">Mozambique (Moçambique)</option>
  318. <option value="MM">Myanmar [Burma] (Myanmar (Burma))</option>
  319. <option value="NA">Namibia</option>
  320. <option value="NR">Nauru (Naoero)</option>
  321. <option value="NP">Nepal (नेपाल)</option>
  322. <option value="AN">Netherlands Antilles</option>
  323. <option value="NC">New Caledonia</option>
  324. <option value="NZ">New Zealand</option>
  325. <option value="NI">Nicaragua</option>
  326. <option value="NE">Niger</option>
  327. <option value="NG">Nigeria</option>
  328. <option value="NU">Niue</option>
  329. <option value="NF">Norfolk Island</option>
  330. <option value="MP">Northern Mariana Islands</option>
  331. <option value="KP">North Korea (조선)</option>
  332. <option value="OM">Oman (‫عمان‬‎)</option>
  333. <option value="PK">Pakistan (‫پاکستان‬‎)</option>
  334. <option value="PW">Palau (Belau)</option>
  335. <option value="PS">Palestinian Territories</option>
  336. <option value="PA">Panama (Panamá)</option>
  337. <option value="PG">Papua New Guinea</option>
  338. <option value="PY">Paraguay</option>
  339. <option value="PE">Peru (Perú)</option>
  340. <option value="PH">Philippines (Pilipinas)</option>
  341. <option value="PN">Pitcairn Islands</option>
  342. <option value="PR">Puerto Rico</option>
  343. <option value="QA">Qatar (‫قطر‬‎)</option>
  344. <option value="RE">Réunion</option>
  345. <option value="RW">Rwanda</option>
  346. <option value="SH">Saint Helena</option>
  347. <option value="KN">Saint Kitts and Nevis</option>
  348. <option value="LC">Saint Lucia</option>
  349. <option value="PM">Saint Pierre and Miquelon</option>
  350. <option value="VC">Saint Vincent and the Grenadines</option>
  351. <option value="WS">Samoa</option>
  352. <option value="ST">São Tomé and Príncipe</option>
  353. <option value="SA">Saudi Arabia (‫المملكة العربية السعودية‬‎)</option>
  354. <option value="SN">Senegal (Sénégal)</option>
  355. <option value="SC">Seychelles</option>
  356. <option value="SL">Sierra Leone</option>
  357. <option value="SG">Singapore (Singapura)</option>
  358. <option value="SB">Solomon Islands</option>
  359. <option value="SO">Somalia (Soomaaliya)</option>
  360. <option value="ZA">South Africa</option>
  361. <option value="GS">South Georgia and the South Sandwich Islands</option>
  362. <option value="KR">South Korea (한국)</option>
  363. <option value="LK">Sri Lanka</option>
  364. <option value="SD">Sudan (‫السودان‬‎)</option>
  365. <option value="SR">Suriname</option>
  366. <option value="SJ">Svalbard and Jan Mayen</option>
  367. <option value="SZ">Swaziland</option>
  368. <option value="SY">Syria (‫سوريا‬‎)</option>
  369. <option value="TW">Taiwan (台灣)</option>
  370. <option value="TJ">Tajikistan (Тоҷикистон)</option>
  371. <option value="TZ">Tanzania</option>
  372. <option value="TH">Thailand (ราชอาณาจักรไทย)</option>
  373. <option value="TL">Timor-Leste</option>
  374. <option value="TG">Togo</option>
  375. <option value="TK">Tokelau</option>
  376. <option value="TO">Tonga</option>
  377. <option value="TT">Trinidad and Tobago</option>
  378. <option value="TN">Tunisia (‫تونس‬‎)</option>
  379. <option value="TM">Turkmenistan (Türkmenistan)</option>
  380. <option value="TC">Turks and Caicos Islands</option>
  381. <option value="TV">Tuvalu</option>
  382. <option value="UM">U.S. Minor Outlying Islands</option>
  383. <option value="VI">U.S. Virgin Islands</option>
  384. <option value="UG">Uganda</option>
  385. <option value="AE">United Arab Emirates (‫الإمارات العربيّة المتّحدة‬‎)</option>
  386. <option value="US">United States</option>
  387. <option value="UY">Uruguay</option>
  388. <option value="UZ">Uzbekistan (O&#39;zbekiston)</option>
  389. <option value="VU">Vanuatu</option>
  390. <option value="VE">Venezuela</option>
  391. <option value="VN">Vietnam (Việt Nam)</option>
  392. <option value="WF">Wallis and Futuna</option>
  393. <option value="EH">Western Sahara (‫الصحراء الغربية‬‎)</option>
  394. <option value="YE">Yemen (‫اليمن‬‎)</option>
  395. <option value="ZM">Zambia</option>
  396. <option value="ZW">Zimbabwe</option>
  397. </xsl:template>
  398. </xsl:stylesheet>