bootstrap.php 15 KB

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