bootstrap.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <?php
  2. use PrivateBin\I18n;
  3. ?><!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="utf-8" />
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <meta name="robots" content="noindex" />
  10. <title><?php echo I18n::_('PrivateBin'); ?></title>
  11. <link type="text/css" rel="stylesheet" href="css/bootstrap/bootstrap-3.3.5.css" />
  12. <link type="text/css" rel="stylesheet" href="css/bootstrap/bootstrap-theme-3.3.5.css" />
  13. <link type="text/css" rel="stylesheet" href="css/bootstrap/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
  14. <?php
  15. if ($SYNTAXHIGHLIGHTING):
  16. ?>
  17. <link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
  18. <?php
  19. if (strlen($SYNTAXHIGHLIGHTINGTHEME)):
  20. ?>
  21. <link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
  22. <?php
  23. endif;
  24. endif;
  25. ?>
  26. <script type="text/javascript" src="js/jquery-1.11.3.js" integrity="sha512-xAERw8wHVOkM9x9y9/FvQ7g1t+gIQj39mfkN1Rd1OLcC5k/x2e6NO8hq6qEbb3oO+CYYTjVLFiFYg5/7ddF0zA==" crossorigin="anonymous"></script>
  27. <script type="text/javascript" src="js/sjcl-1.0.4.js" integrity="sha512-BqVQ8GgWfMCcdsDuP6Ggm1BV7+mmoWH3PC4UqcYpEKSdEq1rthy6NUsa6gu5sydewbi/ilI3E3ohdCxlPPF9ww==" crossorigin="anonymous"></script>
  28. <?php
  29. if ($ZEROBINCOMPATIBILITY):
  30. ?>
  31. <script type="text/javascript" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  32. <?php
  33. else:
  34. ?>
  35. <script type="text/javascript" src="js/base64-2.1.9.js" integrity="sha512-rbqAby7hObftbEoGQzkhUbEh5YkUn2MtekTLs4btvo2oly4CZ3DxhJzEh0u/rNzS54tcJdqi5Ug1ruugEd2U1g==" crossorigin="anonymous"></script>
  36. <?php
  37. endif;
  38. ?>
  39. <script type="text/javascript" src="js/rawdeflate-0.5.js" integrity="sha512-tTdZ7qMr7tt5VQy4iCHu6/aGB12eRwbUy+AEI5rXntfsjcRfBeeqJloMsBU9FrGk1bIYLiuND/FhU42LO1bi0g==" crossorigin="anonymous"></script>
  40. <script type="text/javascript" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  41. <script type="text/javascript" src="js/bootstrap-3.3.5.js" integrity="sha512-/W33QnLmSAP1fwINS9iXgB6s/VOIG9GVdIuIYaUtbSvKPMv5S08PtT3PqnT2WjwBgB8DFeDN2nqJroqQYF7SwQ==" crossorigin="anonymous"></script>
  42. <?php
  43. if ($SYNTAXHIGHLIGHTING):
  44. ?>
  45. <script type="text/javascript" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-m8iHxoN+Fe12xxFwWNdY/TS4KoFntHp29qY0xUzBnPd0bkKMOR/dFhEdTWydpt0b/fIXyhB+znGYUvgjfJ2RzQ==" crossorigin="anonymous"></script>
  46. <?php
  47. endif;
  48. if ($MARKDOWN):
  49. ?>
  50. <script type="text/javascript" src="js/showdown-1.4.1.js" integrity="sha512-Kbz1FIlDnqUJu/3yW8H8USzURA3JuUqSKRwz13lM4kWt6C0n6s4tjl81PCfnWtE4gBIzyj5uGePcfUyotk/icw==" crossorigin="anonymous"></script>
  51. <?php
  52. endif;
  53. ?>
  54. <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-E9z1cIXJHhc940FLA4o//dRxoy5HwSeRZVgLClmREWl+o576zz3gOkMwxrUFVXKUMa2l2qc6huNwMpw+RGmk2Q==" crossorigin="anonymous"></script>
  55. <!--[if lt IE 10]>
  56. <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
  57. <![endif]-->
  58. <link rel="apple-touch-icon" href="apple-touch-icon.png?<?php echo rawurlencode($VERSION); ?>" sizes="180x180" />
  59. <link rel="icon" type="image/png" href="favicon-32x32.png?<?php echo rawurlencode($VERSION); ?>" sizes="32x32" />
  60. <link rel="icon" type="image/png" href="favicon-16x16.png?<?php echo rawurlencode($VERSION); ?>" sizes="16x16" />
  61. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  62. <link rel="mask-icon" href="safari-pinned-tab.svg?<?php echo rawurlencode($VERSION); ?>" color="#ffcc00" />
  63. <link rel="shortcut icon" href="favicon.ico">
  64. <meta name="msapplication-config" content="browserconfig.xml">
  65. <meta name="theme-color" content="#ffe57e" />
  66. </head>
  67. <body role="document">
  68. <nav class="navbar navbar-default navbar-static-top">
  69. <div class="navbar-header">
  70. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  71. <span class="sr-only"><?php echo I18n::_('Toggle navigation'); ?></span>
  72. <span class="icon-bar"></span>
  73. <span class="icon-bar"></span>
  74. <span class="icon-bar"></span>
  75. </button>
  76. <a class="reloadlink navbar-brand" href="/">
  77. <img alt="<?php echo I18n::_('PrivateBin'); ?>" src="img/icon.svg" width="45" />
  78. </a>
  79. </div>
  80. <div id="navbar" class="navbar-collapse collapse">
  81. <ul class="nav navbar-nav">
  82. <li>
  83. <button id="newbutton" type="button" class="reloadlink hidden btn btn-default navbar-btn">
  84. <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL; ?>
  85. </button>
  86. <?php
  87. if ($EXPIRECLONE):
  88. ?>
  89. <button id="clonebutton" type="button" class="hidden btn btn-default navbar-btn">
  90. <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
  91. </button>
  92. <?php
  93. endif;
  94. ?>
  95. <button id="rawtextbutton" type="button" class="hidden btn btn-default navbar-btn">
  96. <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
  97. </button>
  98. </li>
  99. <li class="dropdown">
  100. <select id="pasteExpiration" name="pasteExpiration" class="hidden">
  101. <?php
  102. foreach ($EXPIRE as $key => $value):
  103. ?>
  104. <option value="<?php echo $key; ?>"<?php
  105. if ($key == $EXPIREDEFAULT):
  106. ?> selected="selected"<?php
  107. endif;
  108. ?>><?php echo $value; ?></option>
  109. <?php
  110. endforeach;
  111. ?>
  112. </select>
  113. <a id="expiration" href="#" class="hidden dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo I18n::_('Expires'); ?>: <span id="pasteExpirationDisplay"><?php echo $EXPIRE[$EXPIREDEFAULT]; ?></span> <span class="caret"></span></a>
  114. <ul class="dropdown-menu">
  115. <?php
  116. foreach ($EXPIRE as $key => $value):
  117. ?>
  118. <li>
  119. <a href="#" data-expiration="<?php echo $key; ?>">
  120. <?php echo $value, PHP_EOL; ?>
  121. </a>
  122. </li>
  123. <?php
  124. endforeach;
  125. ?>
  126. </ul>
  127. </li>
  128. <li>
  129. <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
  130. <label>
  131. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  132. if ($BURNAFTERREADINGSELECTED):
  133. ?> checked="checked"<?php
  134. endif;
  135. ?> />
  136. <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
  137. </label>
  138. </div>
  139. </li>
  140. <?php
  141. if ($DISCUSSION):
  142. ?>
  143. <li>
  144. <div id="opendisc" class="navbar-text checkbox hidden">
  145. <label>
  146. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  147. if ($OPENDISCUSSION):
  148. ?> checked="checked"<?php
  149. endif;
  150. ?> />
  151. <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
  152. </label>
  153. </div>
  154. </li>
  155. <?php
  156. endif;
  157. if ($PASSWORD):
  158. ?>
  159. <li>
  160. <div id="password" class="navbar-form hidden">
  161. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" class="form-control" size="19" />
  162. </div>
  163. </li>
  164. <?php
  165. endif;
  166. if ($FILEUPLOAD):
  167. ?>
  168. <li id="attach" class="hidden dropdown">
  169. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo I18n::_('Attach a file'); ?> <span class="caret"></span></a>
  170. <ul class="dropdown-menu">
  171. <li id="filewrap">
  172. <div>
  173. <input type="file" id="file" name="file" />
  174. </div>
  175. </li>
  176. <li>
  177. <a id="fileremovebutton" href="#">
  178. <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
  179. </a>
  180. </li>
  181. </ul>
  182. </li>
  183. <?php
  184. endif;
  185. ?>
  186. <li class="dropdown">
  187. <select id="pasteFormatter" name="pasteFormatter" class="hidden">
  188. <?php
  189. foreach ($FORMATTER as $key => $value):
  190. ?>
  191. <option value="<?php echo $key; ?>"<?php
  192. if ($key == $FORMATTERDEFAULT):
  193. ?> selected="selected"<?php
  194. endif;
  195. ?>><?php echo $value; ?></option>
  196. <?php
  197. endforeach;
  198. ?>
  199. </select>
  200. <a id="formatter" href="#" class="hidden dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo I18n::_('Format'); ?>: <span id="pasteFormatterDisplay"><?php echo $FORMATTER[$FORMATTERDEFAULT]; ?></span> <span class="caret"></span></a>
  201. <ul class="dropdown-menu">
  202. <?php
  203. foreach ($FORMATTER as $key => $value):
  204. ?>
  205. <li>
  206. <a href="#" data-format="<?php echo $key; ?>">
  207. <?php echo $value, PHP_EOL; ?>
  208. </a>
  209. </li>
  210. <?php
  211. endforeach;
  212. ?>
  213. </ul>
  214. </li>
  215. </ul>
  216. <ul class="nav navbar-nav pull-right">
  217. <?php
  218. if (strlen($LANGUAGESELECTION)):
  219. ?>
  220. <li id="language" class="dropdown">
  221. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-flag" aria-hidden="true"></span> <?php echo $LANGUAGES[$LANGUAGESELECTION][0]; ?> <span class="caret"></span></a>
  222. <ul class="dropdown-menu">
  223. <?php
  224. foreach ($LANGUAGES as $key => $value):
  225. ?>
  226. <li>
  227. <a href="#" data-lang="<?php echo $key; ?>">
  228. <?php echo $value[0]; ?> (<?php echo $value[1]; ?>)
  229. </a>
  230. </li>
  231. <?php
  232. endforeach;
  233. ?>
  234. </ul>
  235. </li>
  236. <?php
  237. endif;
  238. ?>
  239. <li>
  240. <button id="sendbutton" type="button" class="hidden btn btn-primary navbar-btn">
  241. <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Send'), PHP_EOL; ?>
  242. </button>
  243. </li>
  244. </ul>
  245. </div>
  246. </nav>
  247. <header class="container">
  248. <?php
  249. if (strlen($NOTICE)):
  250. ?>
  251. <div role="alert" class="alert alert-info">
  252. <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <?php echo htmlspecialchars($NOTICE), PHP_EOL; ?>
  253. </div>
  254. <?php
  255. endif;
  256. ?>
  257. <div id="remainingtime" role="alert" class="hidden alert alert-info">
  258. <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
  259. </div>
  260. <?php
  261. if ($FILEUPLOAD):
  262. ?>
  263. <div id="attachment" role="alert" class="hidden alert alert-info">
  264. <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <a><?php echo I18n::_('Download attachment'); ?></a> <span id="clonedfile" class="hidden"><?php echo I18n::_('Cloned file attached.'); ?></span>
  265. </div>
  266. <?php
  267. endif;
  268. if (strlen($STATUS)):
  269. ?>
  270. <div id="status" role="alert" class="alert alert-success">
  271. <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <?php echo htmlspecialchars($STATUS), PHP_EOL; ?>
  272. </div>
  273. <?php
  274. endif;
  275. ?>
  276. <div id="errormessage" role="alert" class="<?php
  277. if (!strlen($ERROR)):
  278. ?>hidden <?php
  279. endif;
  280. ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
  281. <noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('Javascript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
  282. <div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
  283. <div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
  284. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  285. <a href="https://www.opera.com/">Opera</a>,
  286. <a href="https://www.google.com/chrome">Chrome</a>,
  287. <a href="https://www.apple.com/safari">Safari</a>...
  288. </div>
  289. <div id="pasteresult" role="alert" class="hidden alert alert-success">
  290. <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
  291. <div id="deletelink"></div>
  292. <div id="pastelink">
  293. <?php
  294. if (strlen($URLSHORTENER)):
  295. ?>
  296. <button id="shortenbutton" data-shortener="<?php echo htmlspecialchars($URLSHORTENER); ?>" type="button" class="btn btn-primary">
  297. <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
  298. </button>
  299. <?php
  300. endif;
  301. ?>
  302. </div>
  303. </div>
  304. <ul id="preview" class="nav nav-tabs hidden">
  305. <li role="presentation" class="active"><a id="messageedit" href="#"><?php echo I18n::_('Editor'); ?></a></li>
  306. <li role="presentation"><a id="messagepreview" href="#"><?php echo I18n::_('Preview'); ?></a></li>
  307. </ul>
  308. </header>
  309. <section class="container">
  310. <article class="row">
  311. <div id="image" class="col-md-12 text-center hidden"></div>
  312. <div id="prettymessage" class="col-md-12 hidden">
  313. <pre id="prettyprint" class="col-md-12 prettyprint linenums:1"></pre>
  314. </div>
  315. <div id="cleartext" class="col-md-12 hidden"></div>
  316. <p class="col-md-12"><textarea id="message" name="message" cols="80" rows="25" class="form-control hidden"></textarea></p>
  317. </article>
  318. </section>
  319. <section class="container">
  320. <div id="discussion" class="hidden">
  321. <h4><?php echo I18n::_('Discussion'); ?></h4>
  322. <div id="comments"></div>
  323. </div>
  324. </section>
  325. <footer class="container">
  326. <div class="row">
  327. <h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
  328. <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
  329. <p id="aboutbox" class="col-md-6 col-xs-12">
  330. <?php echo I18n::_('PrivateBin is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted <i>in the browser</i> using 256 bits AES. More information on the <a href="https://github.com/PrivateBin/PrivateBin/wiki">project page</a>.'), PHP_EOL; ?>
  331. </p>
  332. </div>
  333. </footer>
  334. <div id="cipherdata" class="hidden"><?php echo htmlspecialchars($CIPHERDATA, ENT_NOQUOTES); ?></div>
  335. </body>
  336. </html>