diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-10-22 15:42:07 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-10-22 22:36:55 +0200 |
commit | de02b8cb514a95c100d0ec11ab469acfc687ca00 (patch) | |
tree | 9c09a70f4ac2b582ae80dd6e065f700ef460ed11 /application/views/file/html_header.php | |
parent | 36f0185d8c950933099268c69081cabc084545c9 (diff) |
switch design to bootstrap; minor fixes along the way
Initial-work-by: Oliver Mader <b52@reaktor42.de>
Additional-work-by: Markus Cisler <mrkscslr@gmail.com>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/views/file/html_header.php')
-rw-r--r-- | application/views/file/html_header.php | 131 |
1 files changed, 82 insertions, 49 deletions
diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php index 60db38238..67e9d0cca 100644 --- a/application/views/file/html_header.php +++ b/application/views/file/html_header.php @@ -1,52 +1,85 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title><?php echo $title; ?></title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <link rel="stylesheet" type="text/css" href="<?php echo link_with_mtime("/data/paste.css"); ?>" /> -<?php if (file_exists(FCPATH."/data/paste-$current_highlight.css")) {?> - <link rel="stylesheet" type="text/css" href="<?php echo link_with_mtime("/data/paste-$current_highlight.css"); ?>" /> -<?php } ?> - </head> - <body> - <div class="top_bar"> - <a class="raw_link no" href="<?php echo site_url(); ?>">New</a> | - <a class="raw_link no" href="<?php echo site_url($id); ?>">Raw</a> | - <a class="raw_link no" href="<?php echo site_url($id."/plain"); ?>">Plain</a> | - <a class="raw_link no" href="<?php echo site_url($id."/info"); ?>">Info</a> | - Currently: <?php echo $current_highlight; ?> | - Timeout: <?php echo $timeout; ?> - <div style="float:right;"> - <a class="raw_link no" href="<?php echo site_url($id)."/"; ?>">Code</a> | - <a class="raw_link no" href="<?php echo site_url($id."/rmd"); ?>">Render Markdown</a> - </div> +<?php include(FCPATH."application/views/header.php"); ?> + </div> -<script type="text/javascript"> -/* <![CDATA[ */ -function update_anchor_highlight() { - var anchor = window.location.hash.substr(1); - var element = document.getElementById("highlight_line"); - if (element) { - element.parentNode.removeChild(element); - } - anchor = document.getElementById(anchor); - if (!anchor) { - return; - } - var newElement = document.createElement("div"); - newElement.setAttribute("id", "highlight_line"); - newElement.textContent=" "; - anchor.parentNode.insertBefore(newElement, anchor.nextSibling); -} + <script type="text/javascript"> + /* <![CDATA[ */ + window.lexers = <?php echo json_encode($lexers); ?>; + window.paste_base = '<?php echo site_url($id) ?>'; + /* ]]> */ + </script> + + <?php if (isset($error_message)) { ?> + <div class="alert alert-block alert-error" style="text-align: center"> + <?php echo $error_message; ?> + </div> + <?php } ?> -if ("onhashchange" in window) { - window.onload = function () { - update_anchor_highlight(); - } - window.onhashchange = function () { - update_anchor_highlight(); - } -} -/* ]]> */ -</script> + <div class="container" style="padding-top:40px;background:#eee;padding:3px;"> + <div style="border:1px solid #ccc;"> + <div class="navbar navbar-static-top"> + <div class="navbar-inner" style="box-shadow: none;"> + <ul class="nav"> + <li><a href="#file-info" class="brand" data-toggle="modal"><?php echo $title ?></a></li> + <li class="divider-vertical"></li> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="language-toggle"> + Language: <?php echo $current_highlight; ?> + <b class="caret"></b> + </a> + <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;"> + <form> + <input type="text" id="language" placeholder="Language" class="input-medium"> + </form> + </div> + </li> + <li class="divider-vertical"></li> + <li> + <a href="#file-info" role="button" data-toggle="modal">Info</a> + <div id="file-info" class="modal hide fade"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h3>Paste Information</h3> + </div> + <div class="modal-body"> + <table class="table"> + <tr> + <td style="border:0;">Filename:</td> + <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td> + </tr> + <tr> + <td>Size:</td> + <td><?php echo format_bytes($filedata["filesize"]) ?></td> + </tr> + <tr> + <td>Mimetype:</td> + <td><?php echo $filedata["mimetype"] ?></td> + </tr> + <tr> + <td>Uploaded:</td> + <td><?php echo date("r", $filedata["date"]) ?></td> + </tr> + <tr> + <td>Removal:</td> + <td><?php echo $timeout ?></td> + </tr> + </table> + </div> + <div class="modal-footer"> + <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> + </div> + </div> + </li> + </ul> + <div class="btn-group pull-right" style="margin-top: 7px; margin-right:-10px;"> + <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-small" rel="tooltip" title="View as plain text">Plain</a> + <a href="<?php echo site_url($id) ?>" class="btn btn-small" rel="tooltip" title="View as raw file (org. mime type)">Raw</a> + <?php if ($current_highlight === 'rmd') { ?> + <a href="<?php echo site_url($id)."/" ?>" class="btn btn-small" rel="tooltip" title="Render as Code">Code</a> + <?php } else { ?> + <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-small" rel="tooltip" title="Render as Markdown">Markdown</a> + <?php } ?> + </div> + </div> + </div> + <div id="paste-container"> |