bootstrap.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <?php
  2. use PrivateBin\I18n;
  3. $isCpct = substr($template, 9, 8) === '-compact';
  4. $isDark = substr($template, 9, 5) === '-dark';
  5. $isPage = substr($template, -5) === '-page';
  6. ?><!DOCTYPE html>
  7. <html lang="<?php echo I18n::getLanguage(); ?>"<?php echo I18n::isRtl() ? ' dir="rtl"' : ''; ?>>
  8. <head>
  9. <meta charset="utf-8" />
  10. <meta http-equiv="Content-Security-Policy" content="<?php echo I18n::encode($CSPHEADER); ?>">
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  12. <meta name="viewport" content="width=device-width, initial-scale=1">
  13. <meta name="robots" content="noindex" />
  14. <meta name="google" content="notranslate">
  15. <title><?php echo I18n::_($NAME); ?></title>
  16. <?php
  17. if (!$isDark) :
  18. ?>
  19. <link type="text/css" rel="stylesheet" href="css/bootstrap/bootstrap-3.4.1.css" />
  20. <?php
  21. endif;
  22. ?>
  23. <link type="text/css" rel="stylesheet" href="css/bootstrap/bootstrap-theme-3.4.1.css" />
  24. <?php
  25. if ($isDark) :
  26. ?>
  27. <link type="text/css" rel="stylesheet" href="css/bootstrap/darkstrap-0.9.3.css" />
  28. <?php
  29. endif;
  30. ?>
  31. <link type="text/css" rel="stylesheet" href="css/bootstrap/privatebin.css?<?php echo rawurlencode($VERSION); ?>" />
  32. <?php
  33. if ($SYNTAXHIGHLIGHTING) :
  34. ?>
  35. <link type="text/css" rel="stylesheet" href="css/prettify/prettify.css?<?php echo rawurlencode($VERSION); ?>" />
  36. <?php
  37. if (!empty($SYNTAXHIGHLIGHTINGTHEME)) :
  38. ?>
  39. <link type="text/css" rel="stylesheet" href="css/prettify/<?php echo rawurlencode($SYNTAXHIGHLIGHTINGTHEME); ?>.css?<?php echo rawurlencode($VERSION); ?>" />
  40. <?php
  41. endif;
  42. endif;
  43. ?>
  44. <noscript><link type="text/css" rel="stylesheet" href="css/noscript.css" /></noscript>
  45. <script type="text/javascript" data-cfasync="false" src="js/jquery-3.7.1.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous"></script>
  46. <?php
  47. if ($QRCODE) :
  48. ?>
  49. <script async type="text/javascript" data-cfasync="false" src="js/kjua-0.9.0.js" integrity="sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==" crossorigin="anonymous"></script>
  50. <?php
  51. endif;
  52. if ($ZEROBINCOMPATIBILITY) :
  53. ?>
  54. <script type="text/javascript" data-cfasync="false" src="js/base64-1.7.js" integrity="sha512-JdwsSP3GyHR+jaCkns9CL9NTt4JUJqm/BsODGmYhBcj5EAPKcHYh+OiMfyHbcDLECe17TL0hjXADFkusAqiYgA==" crossorigin="anonymous"></script>
  55. <?php
  56. endif;
  57. ?>
  58. <script type="text/javascript" data-cfasync="false" src="js/zlib-1.3.1.js" integrity="sha512-Z90oppVx/mn0DG2k9airjFVQuliELlXLeT3SRiO6MLiUSbhGlAq+UFwmYbG4i9mwW87dkG8fgJPapGwnUq7Osg==" crossorigin="anonymous"></script>
  59. <script type="text/javascript" data-cfasync="false" src="js/base-x-4.0.0.js" integrity="sha512-nNPg5IGCwwrveZ8cA/yMGr5HiRS5Ps2H+s0J/mKTPjCPWUgFGGw7M5nqdnPD3VsRwCVysUh3Y8OWjeSKGkEQJQ==" crossorigin="anonymous"></script>
  60. <script type="text/javascript" data-cfasync="false" src="js/rawinflate-0.3.js" integrity="sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==" crossorigin="anonymous"></script>
  61. <script type="text/javascript" data-cfasync="false" src="js/bootstrap-3.4.1.js" integrity="sha512-oBTprMeNEKCnqfuqKd6sbvFzmFQtlXS3e0C/RGFV0hD6QzhHV+ODfaQbAlmY6/q0ubbwlAM/nCJjkrgA3waLzg==" crossorigin="anonymous"></script>
  62. <?php
  63. if ($SYNTAXHIGHLIGHTING) :
  64. ?>
  65. <script type="text/javascript" data-cfasync="false" src="js/prettify.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==" crossorigin="anonymous"></script>
  66. <?php
  67. endif;
  68. if ($MARKDOWN) :
  69. ?>
  70. <script type="text/javascript" data-cfasync="false" src="js/showdown-2.1.0.js" integrity="sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==" crossorigin="anonymous"></script>
  71. <?php
  72. endif;
  73. ?>
  74. <script type="text/javascript" data-cfasync="false" src="js/purify-3.1.2.js" integrity="sha512-voYCOVXik5/jcT+McTiptsB00iB0NWQrhBmSwSEfj0IH3UDphU8w12JV8w1y+m8FRaozbzW4efHSEWKZpOA+JQ==" crossorigin="anonymous"></script>
  75. <script type="text/javascript" data-cfasync="false" src="js/legacy.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYos+qXHIRqFf5ZPNphvtTB0cgzHUizu2wwcOwcwz/VIpRv9lpcBgPYz4uq6jx0INwCAj6Fbnl5HoKiLufS2jg==" crossorigin="anonymous"></script>
  76. <script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QnwyZIEFZg8uvFAsnXbeHTNarA4hPhGcMv8RTAIS4cOgR6oh0ofxjY3OdiGzccArf6VeFFKjqkFo94CrcUXkxQ==" crossorigin="anonymous"></script>
  77. <!-- icon -->
  78. <link rel="apple-touch-icon" href="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" sizes="180x180" />
  79. <link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" />
  80. <link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16" />
  81. <link rel="manifest" href="manifest.json?<?php echo rawurlencode($VERSION); ?>" />
  82. <link rel="mask-icon" href="img/safari-pinned-tab.svg" color="#ffcc00" />
  83. <link rel="shortcut icon" href="img/favicon.ico">
  84. <meta name="msapplication-config" content="browserconfig.xml">
  85. <meta name="theme-color" content="#ffe57e" />
  86. <!-- Twitter/social media cards -->
  87. <meta name="twitter:card" content="summary" />
  88. <meta name="twitter:title" content="<?php echo I18n::_('Encrypted note on %s', I18n::_($NAME)) ?>" />
  89. <meta name="twitter:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
  90. <meta name="twitter:image" content="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" />
  91. <meta property="og:title" content="<?php echo I18n::_($NAME); ?>" />
  92. <meta property="og:site_name" content="<?php echo I18n::_($NAME); ?>" />
  93. <meta property="og:description" content="<?php echo I18n::_('Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.') ?>" />
  94. <meta property="og:image" content="<?php echo I18n::encode($BASEPATH); ?>img/apple-touch-icon.png" />
  95. <meta property="og:image:type" content="image/png" />
  96. <meta property="og:image:width" content="180" />
  97. <meta property="og:image:height" content="180" />
  98. </head>
  99. <body role="document" data-compression="<?php echo rawurlencode($COMPRESSION); ?>"<?php
  100. $class = array();
  101. if ($isCpct) {
  102. $class[] = 'navbar-spacing';
  103. }
  104. if ($isDark) {
  105. $class[] = 'dark-theme';
  106. }
  107. if (count($class)) {
  108. echo ' class="', implode(' ', $class), '"';
  109. }
  110. ?>>
  111. <div id="passwordmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
  112. <div class="modal-dialog" role="document">
  113. <div class="modal-content">
  114. <div class="modal-body">
  115. <form id="passwordform" role="form">
  116. <div class="form-group">
  117. <label for="passworddecrypt"><span class="glyphicon glyphicon-eye-open"></span> <?php echo I18n::_('Please enter the password for this paste:') ?></label>
  118. <input id="passworddecrypt" type="password" class="form-control" placeholder="<?php echo I18n::_('Enter password') ?>" required="required">
  119. </div>
  120. <button type="submit" class="btn btn-success btn-block"><span class="glyphicon glyphicon-off"></span> <?php echo I18n::_('Decrypt') ?></button>
  121. </form>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div id="loadconfirmmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
  127. <div class="modal-dialog" role="document">
  128. <div class="modal-content">
  129. <div class="modal-header">
  130. <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"><span aria-hidden="true">&times;</span></button>
  131. <h4 class="modal-title"><?php echo I18n::_('This secret message can only be displayed once. Would you like to see it now?') ?></h4>
  132. </div>
  133. <div class="modal-body text-center">
  134. <button id="loadconfirm-open-now" type="button" class="btn btn-success" data-dismiss="modal"><span class="glyphicon glyphicon-download"></span> <?php echo I18n::_('Yes, see it') ?></button>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <?php
  140. if ($QRCODE) :
  141. ?>
  142. <div id="qrcodemodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
  143. <div class="modal-dialog" role="document">
  144. <div class="modal-content">
  145. <div class="modal-header">
  146. <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"><span aria-hidden="true">&times;</span></button>
  147. <h4 class="modal-title"><?php echo I18n::_('QR code') ?></h4>
  148. </div>
  149. <div class="modal-body">
  150. <div class="mx-auto" id="qrcode-display"></div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <?php
  156. endif;
  157. if ($EMAIL) :
  158. ?>
  159. <div id="emailconfirmmodal" tabindex="-1" class="modal fade" role="dialog" aria-hidden="true">
  160. <div class="modal-dialog" role="document">
  161. <div class="modal-content">
  162. <div class="modal-header">
  163. <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo I18n::_('Close') ?>"><span aria-hidden="true">&times;</span></button>
  164. <h4 class="modal-title"><?php echo I18n::_('Recipient may become aware of your timezone, convert time to UTC?') ?></h4>
  165. </div>
  166. <div class="modal-body row">
  167. <div class="col-xs-12 col-md-6">
  168. <button id="emailconfirm-timezone-current" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-time"></span> <?php echo I18n::_('Use Current Timezone') ?></button>
  169. </div>
  170. <div class="col-xs-12 col-md-6 text-right">
  171. <button id="emailconfirm-timezone-utc" type="button" class="btn btn-success"><span class="glyphicon glyphicon-globe"></span> <?php echo I18n::_('Convert To UTC') ?></button>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <?php
  178. endif;
  179. ?>
  180. <nav class="navbar navbar-<?php echo $isDark ? 'inverse' : 'default'; ?> navbar-<?php echo $isCpct ? 'fixed' : 'static'; ?>-top"><?php
  181. if ($isCpct) :
  182. ?><div class="container"><?php
  183. endif;
  184. ?>
  185. <div class="navbar-header">
  186. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  187. <span class="sr-only"><?php echo I18n::_('Toggle navigation'); ?></span>
  188. <span class="icon-bar"></span>
  189. <span class="icon-bar"></span>
  190. <span class="icon-bar"></span>
  191. </button>
  192. <a class="reloadlink navbar-brand" href="">
  193. <img alt="<?php echo I18n::_($NAME); ?>" src="img/icon.svg" width="38" />
  194. </a>
  195. </div>
  196. <div id="navbar" class="navbar-collapse collapse">
  197. <ul class="nav navbar-nav">
  198. <li id="loadingindicator" class="navbar-text hidden">
  199. <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
  200. <?php echo I18n::_('Loading…'), PHP_EOL; ?>
  201. </li>
  202. <li>
  203. <button id="retrybutton" type="button" class="reloadlink hidden btn btn-<?php echo $isDark ? 'warning' : 'primary'; ?> navbar-btn">
  204. <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span> <?php echo I18n::_('Retry'), PHP_EOL; ?>
  205. </button>
  206. </li>
  207. <li>
  208. <?php
  209. if ($isPage) :
  210. ?>
  211. <button id="sendbutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'primary'; ?> navbar-btn">
  212. <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Create'), PHP_EOL;
  213. else :
  214. ?>
  215. <button id="newbutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  216. <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL;
  217. endif;
  218. ?>
  219. </button>
  220. <button id="clonebutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  221. <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <?php echo I18n::_('Clone'), PHP_EOL; ?>
  222. </button>
  223. <button id="rawtextbutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  224. <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <?php echo I18n::_('Raw text'), PHP_EOL; ?>
  225. </button>
  226. <button id="downloadtextbutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  227. <span class="glyphicon glyphicon glyphicon-download-alt" aria-hidden="true"></span> <?php echo I18n::_('Save paste'), PHP_EOL; ?>
  228. </button>
  229. <?php
  230. if ($EMAIL) :
  231. ?>
  232. <button id="emaillink" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  233. <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> <?php echo I18n::_('Email'), PHP_EOL; ?>
  234. </button>
  235. <?php
  236. endif;
  237. if ($QRCODE) :
  238. ?>
  239. <button id="qrcodelink" type="button" data-toggle="modal" data-target="#qrcodemodal" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?> navbar-btn">
  240. <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span> <?php echo I18n::_('QR code'), PHP_EOL; ?>
  241. </button>
  242. <?php
  243. endif;
  244. ?>
  245. </li>
  246. <li class="dropdown">
  247. <select id="pasteExpiration" name="pasteExpiration" class="hidden">
  248. <?php
  249. foreach ($EXPIRE as $key => $value) :
  250. ?>
  251. <option value="<?php echo $key; ?>"<?php
  252. if ($key == $EXPIREDEFAULT) :
  253. ?> selected="selected"<?php
  254. endif;
  255. ?>><?php echo $value; ?></option>
  256. <?php
  257. endforeach;
  258. ?>
  259. </select>
  260. <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>
  261. <ul class="dropdown-menu">
  262. <?php
  263. foreach ($EXPIRE as $key => $value) :
  264. ?>
  265. <li>
  266. <a href="#" data-expiration="<?php echo $key; ?>">
  267. <?php echo $value, PHP_EOL; ?>
  268. </a>
  269. </li>
  270. <?php
  271. endforeach;
  272. ?>
  273. </ul>
  274. </li>
  275. <?php
  276. if ($isCpct) :
  277. ?>
  278. <li class="dropdown">
  279. <a id="formatter" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo I18n::_('Options'); ?> <span class="caret"></span></a>
  280. <ul class="dropdown-menu">
  281. <li id="burnafterreadingoption" class="checkbox hidden">
  282. <label>
  283. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  284. if ($BURNAFTERREADINGSELECTED) :
  285. ?> checked="checked"<?php
  286. endif;
  287. ?> />
  288. <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
  289. </label>
  290. </li>
  291. <?php
  292. if ($DISCUSSION) :
  293. ?>
  294. <li id="opendiscussionoption" class="checkbox hidden">
  295. <label>
  296. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  297. if ($OPENDISCUSSION) :
  298. ?> checked="checked"<?php
  299. endif;
  300. ?> />
  301. <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
  302. </label>
  303. </li>
  304. <?php
  305. endif;
  306. ?>
  307. <li role="separator" class="divider"></li>
  308. <li>
  309. <div>
  310. <?php echo I18n::_('Format'); ?>: <span id="pasteFormatterDisplay"><?php echo $FORMATTER[$FORMATTERDEFAULT]; ?></span> <span class="caret"></span>
  311. </div>
  312. </li>
  313. <?php
  314. foreach ($FORMATTER as $key => $value) :
  315. ?>
  316. <li>
  317. <a href="#" data-format="<?php echo $key; ?>">
  318. <?php echo $value, PHP_EOL; ?>
  319. </a>
  320. </li>
  321. <?php
  322. endforeach;
  323. ?>
  324. </ul>
  325. <select id="pasteFormatter" name="pasteFormatter" class="hidden">
  326. <?php
  327. foreach ($FORMATTER as $key => $value) :
  328. ?>
  329. <option value="<?php echo $key; ?>"<?php
  330. if ($key == $FORMATTERDEFAULT) :
  331. ?> selected="selected"<?php
  332. endif;
  333. ?>><?php echo $value; ?></option>
  334. <?php
  335. endforeach;
  336. ?>
  337. </select>
  338. </li>
  339. <?php
  340. else :
  341. ?>
  342. <li>
  343. <div id="burnafterreadingoption" class="navbar-text checkbox hidden">
  344. <label>
  345. <input type="checkbox" id="burnafterreading" name="burnafterreading"<?php
  346. if ($BURNAFTERREADINGSELECTED) :
  347. ?> checked="checked"<?php
  348. endif;
  349. ?> />
  350. <?php echo I18n::_('Burn after reading'), PHP_EOL; ?>
  351. </label>
  352. </div>
  353. </li>
  354. <?php
  355. if ($DISCUSSION) :
  356. ?>
  357. <li>
  358. <div id="opendiscussionoption" class="navbar-text checkbox hidden">
  359. <label>
  360. <input type="checkbox" id="opendiscussion" name="opendiscussion"<?php
  361. if ($OPENDISCUSSION) :
  362. ?> checked="checked"<?php
  363. endif;
  364. ?> />
  365. <?php echo I18n::_('Open discussion'), PHP_EOL; ?>
  366. </label>
  367. </div>
  368. </li>
  369. <?php
  370. endif;
  371. endif;
  372. if ($PASSWORD) :
  373. ?>
  374. <li>
  375. <div id="password" class="navbar-form hidden">
  376. <input type="password" id="passwordinput" placeholder="<?php echo I18n::_('Password (recommended)'); ?>" class="form-control" size="23" />
  377. </div>
  378. </li>
  379. <?php
  380. endif;
  381. if ($FILEUPLOAD) :
  382. ?>
  383. <li id="attach" class="hidden dropdown">
  384. <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>
  385. <ul class="dropdown-menu">
  386. <li id="filewrap">
  387. <div>
  388. <input type="file" id="file" name="file" />
  389. </div>
  390. <div id="dragAndDropFileName" class="dragAndDropFile"><?php echo I18n::_('alternatively drag & drop a file or paste an image from the clipboard'); ?></div>
  391. </li>
  392. <li id="customattachment" class="hidden"></li>
  393. <li>
  394. <a id="fileremovebutton" href="#">
  395. <?php echo I18n::_('Remove attachment'), PHP_EOL; ?>
  396. </a>
  397. </li>
  398. </ul>
  399. </li>
  400. <?php
  401. endif;
  402. if (!$isCpct) :
  403. ?>
  404. <li class="dropdown">
  405. <select id="pasteFormatter" name="pasteFormatter" class="hidden">
  406. <?php
  407. foreach ($FORMATTER as $key => $value) :
  408. ?>
  409. <option value="<?php echo $key; ?>"<?php
  410. if ($key == $FORMATTERDEFAULT) :
  411. ?> selected="selected"<?php
  412. endif;
  413. ?>><?php echo $value; ?></option>
  414. <?php
  415. endforeach;
  416. ?>
  417. </select>
  418. <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>
  419. <ul class="dropdown-menu">
  420. <?php
  421. foreach ($FORMATTER as $key => $value) :
  422. ?>
  423. <li>
  424. <a href="#" data-format="<?php echo $key; ?>">
  425. <?php echo $value, PHP_EOL; ?>
  426. </a>
  427. </li>
  428. <?php
  429. endforeach;
  430. ?>
  431. </ul>
  432. </li>
  433. <?php
  434. endif;
  435. ?>
  436. </ul>
  437. <ul class="nav navbar-nav pull-right">
  438. <?php
  439. if (!empty($LANGUAGESELECTION)) :
  440. ?>
  441. <li id="language" class="dropdown">
  442. <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>
  443. <ul class="dropdown-menu dropdown-menu-right">
  444. <?php
  445. foreach ($LANGUAGES as $key => $value) :
  446. ?>
  447. <li>
  448. <a href="#" data-lang="<?php echo $key; ?>">
  449. <?php echo $value[0]; ?> (<?php echo $value[1]; ?>)
  450. </a>
  451. </li>
  452. <?php
  453. endforeach;
  454. ?>
  455. </ul>
  456. </li>
  457. <?php
  458. endif;
  459. ?>
  460. </ul>
  461. </div>
  462. <?php
  463. if ($isCpct) :
  464. ?></div><?php
  465. endif;
  466. ?></nav>
  467. <main>
  468. <section class="container">
  469. <?php
  470. if (!empty($NOTICE)) :
  471. ?>
  472. <div role="alert" class="alert alert-info">
  473. <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
  474. <?php echo I18n::encode($NOTICE), PHP_EOL; ?>
  475. </div>
  476. <?php
  477. endif;
  478. ?>
  479. <div id="remainingtime" role="alert" class="hidden alert alert-info">
  480. <span class="glyphicon glyphicon-fire" aria-hidden="true"></span>
  481. </div>
  482. <?php
  483. if ($FILEUPLOAD) :
  484. ?>
  485. <div id="attachment" role="alert" class="hidden alert alert-info">
  486. <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
  487. <a class="alert-link"><?php echo I18n::_('Download attachment'); ?></a>
  488. </div>
  489. <?php
  490. endif;
  491. ?>
  492. <div id="status" role="alert" class="alert alert-info<?php echo empty($STATUS) ? ' hidden' : '' ?>">
  493. <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
  494. <?php echo I18n::encode($STATUS), PHP_EOL; ?>
  495. </div>
  496. <div id="errormessage" role="alert" class="<?php echo empty($ERROR) ? 'hidden' : '' ?> alert alert-danger">
  497. <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
  498. <?php echo I18n::encode($ERROR), PHP_EOL; ?>
  499. </div>
  500. <noscript>
  501. <div id="noscript" role="alert" class="alert alert-<?php echo $isDark ? 'error' : 'warning'; ?>">
  502. <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  503. <?php echo I18n::_('JavaScript is required for %s to work. Sorry for the inconvenience.', I18n::_($NAME)), PHP_EOL; ?>
  504. </div>
  505. </noscript>
  506. <div id="oldnotice" role="alert" class="hidden alert alert-danger">
  507. <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
  508. <?php echo I18n::_('%s requires a modern browser to work.', I18n::_($NAME)), PHP_EOL; ?>
  509. <a href="https://www.mozilla.org/firefox/">Firefox</a>,
  510. <a href="https://www.opera.com/">Opera</a>,
  511. <a href="https://www.google.com/chrome">Chrome</a>…<br />
  512. <span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-the-error-privatebin-requires-a-modern-browser-to-work'); ?></span>
  513. </div>
  514. <?php
  515. if ($HTTPWARNING) :
  516. ?>
  517. <div id="httpnotice" role="alert" class="hidden alert alert-danger">
  518. <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
  519. <?php echo I18n::_('This website is using an insecure connection! Please only use it for testing.'); ?><br />
  520. <span class="small"><?php echo I18n::_('For more information <a href="%s">see this FAQ entry</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-it-show-me-an-error-about-an-insecure-connection'); ?></span>
  521. </div>
  522. <div id="insecurecontextnotice" role="alert" class="hidden alert alert-danger">
  523. <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
  524. <?php echo I18n::_('Your browser may require an HTTPS connection to support the WebCrypto API. Try <a href="%s">switching to HTTPS</a>.', $HTTPSLINK), PHP_EOL; ?>
  525. </div>
  526. <?php
  527. endif;
  528. ?>
  529. <div id="pastesuccess" class="hidden">
  530. <div role="alert" class="alert alert-success">
  531. <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
  532. <div id="deletelink"></div>
  533. <div id="pastelink"></div>
  534. </div>
  535. <?php
  536. if (!empty($URLSHORTENER)) :
  537. ?>
  538. <p>
  539. <button id="shortenbutton" data-shortener="<?php echo I18n::encode($URLSHORTENER); ?>" type="button" class="btn btn-<?php echo $isDark ? 'warning' : 'primary'; ?> btn-block">
  540. <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <?php echo I18n::_('Shorten URL'), PHP_EOL; ?>
  541. </button>
  542. </p>
  543. <div role="alert" class="alert alert-danger">
  544. <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  545. <?php echo I18n::_('URL shortener may expose your decrypt key in URL.'), PHP_EOL; ?>
  546. </div>
  547. <?php
  548. endif;
  549. ?>
  550. </div>
  551. <ul id="editorTabs" class="nav nav-tabs hidden">
  552. <li role="presentation" class="active"><a role="tab" aria-selected="true" aria-controls="editorTabs" id="messageedit" href="#"><?php echo I18n::_('Editor'); ?></a></li>
  553. <li role="presentation"><a role="tab" aria-selected="false" aria-controls="editorTabs" id="messagepreview" href="#"><?php echo I18n::_('Preview'); ?></a></li>
  554. <li role="presentation" class="pull-right">
  555. <?php
  556. if ($isPage) :
  557. ?>
  558. <button id="newbutton" type="button" class="reloadlink hidden btn btn-<?php echo $isDark ? 'warning' : 'default'; ?>">
  559. <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <?php echo I18n::_('New'), PHP_EOL;
  560. else :
  561. ?>
  562. <button id="sendbutton" type="button" class="hidden btn btn-<?php echo $isDark ? 'warning' : 'primary'; ?>">
  563. <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <?php echo I18n::_('Create'), PHP_EOL;
  564. endif;
  565. ?>
  566. </button>
  567. </li>
  568. </ul>
  569. </section>
  570. <section class="container">
  571. <article class="row">
  572. <div id="placeholder" class="col-md-12 hidden"><?php echo I18n::_('+++ no paste text +++'); ?></div>
  573. <div id="attachmentPreview" class="col-md-12 text-center hidden"></div>
  574. <div id="prettymessage" class="col-md-12 hidden">
  575. <pre id="prettyprint" class="col-md-12 prettyprint linenums:1"></pre>
  576. </div>
  577. <div id="plaintext" class="col-md-12 hidden"></div>
  578. <p class="col-md-12"><textarea id="message" name="message" cols="80" rows="25" class="form-control hidden"></textarea></p>
  579. </article>
  580. </section>
  581. <section class="container">
  582. <div id="discussion" class="hidden">
  583. <h4><?php echo I18n::_('Discussion'); ?></h4>
  584. <div id="commentcontainer"></div>
  585. </div>
  586. </section>
  587. <section class="container">
  588. <div id="noscript" role="alert" class="alert alert-info noscript-hide">
  589. <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  590. <?php echo I18n::_('Loading…'); ?><br />
  591. <span class="small"><?php echo I18n::_('In case this message never disappears please have a look at <a href="%s">this FAQ for information to troubleshoot</a>.', 'https://github.com/PrivateBin/PrivateBin/wiki/FAQ#why-does-the-loading-message-not-go-away'); ?></span>
  592. </div>
  593. </section>
  594. <footer class="container">
  595. <div class="row">
  596. <h4 class="col-md-5 col-xs-8"><?php echo I18n::_($NAME); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
  597. <p class="col-md-1 col-xs-4 text-center"><?php echo $VERSION; ?></p>
  598. <p id="aboutbox" class="col-md-6 col-xs-12">
  599. <?php echo sprintf(
  600. I18n::_('%s is a minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted %sin the browser%s using 256 bits AES.',
  601. I18n::_($NAME),
  602. '%s', '%s'
  603. ),
  604. '<i>', '</i>'), ' ', $INFO, PHP_EOL;
  605. ?>
  606. </p>
  607. </div>
  608. </footer>
  609. </main>
  610. <?php
  611. if ($DISCUSSION) :
  612. ?>
  613. <div id="serverdata" class="hidden" aria-hidden="true">
  614. <div id="templates">
  615. <article id="commenttemplate" class="comment">
  616. <div class="commentmeta">
  617. <span class="nickname">name</span>
  618. <span class="commentdate">0000-00-00</span>
  619. </div>
  620. <div class="commentdata">c</div>
  621. <button class="btn btn-default btn-sm"><?php echo I18n::_('Reply'); ?></button>
  622. </article>
  623. <p id="commenttailtemplate" class="comment">
  624. <button class="btn btn-default btn-sm"><?php echo I18n::_('Add comment'); ?></button>
  625. </p>
  626. <div id="replytemplate" class="reply hidden">
  627. <input type="text" id="nickname" class="form-control" title="<?php echo I18n::_('Optional nickname…'); ?>" placeholder="<?php echo I18n::_('Optional nickname…'); ?>" />
  628. <textarea id="replymessage" class="replymessage form-control" cols="80" rows="7"></textarea><br />
  629. <div id="replystatus" role="alert" class="statusmessage hidden alert">
  630. <span class="glyphicon" aria-hidden="true"></span>
  631. </div>
  632. <button id="replybutton" class="btn btn-default btn-sm"><?php echo I18n::_('Post comment'); ?></button>
  633. </div>
  634. </div>
  635. </div>
  636. <?php
  637. endif;
  638. ?>
  639. <?php
  640. if ($FILEUPLOAD) :
  641. ?>
  642. <div id="dropzone" class="hidden" tabindex="-1" aria-hidden="true"></div>
  643. <?php
  644. endif;
  645. ?>
  646. </body>
  647. </html>