bootstrap-page.php 13 KB

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