bootstrap.php 27 KB

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