rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 9e68bec2c9c446ddd64b531d2e619a268953341a
parent 2b4641426ace6a9f4c0b8abe432245d78758f573
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue, 13 Jan 2015 18:46:43 +0100

optimize admin in jumbotron

Diffstat:
Mthemes/jumbotron/admin.php | 15++++++++++++---
Dthemes/jumbotron/test.php | 64----------------------------------------------------------------
2 files changed, 12 insertions(+), 67 deletions(-)

diff --git a/themes/jumbotron/admin.php b/themes/jumbotron/admin.php @@ -116,8 +116,15 @@ foreach($langs as $prio => $lang) { return false; } function foo() { - var divid1 = document.getElementById("settings"); - divid1.style.display = "block"; + if(window.location.hash) { + var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character + alert (hash); + var divid1 = document.getElementById(hash); + divid1.style.display = "block"; + } else { + var divid1 = document.getElementById("settings"); + divid1.style.display = "block"; + } } onload = foo; </script> @@ -191,8 +198,10 @@ foreach($langs as $prio => $lang) { <div class="hide_" id="newpost"> <h2>New Post</h2> - <form method="post"> + <form method="post" action=""> + <input type="text" name="title"> <textarea name="content" style="width:100%"></textarea> + <button></button> </form> </div> </div> diff --git a/themes/jumbotron/test.php b/themes/jumbotron/test.php @@ -1,63 +0,0 @@ -<?php -####################### -# flush browser cache # -####################### -header("Cache-Control: no-cache, must-revalidate, no-store"); -?> -<!DOCTYPE html> -<html> -<head> - <!-- Bootstrap core CSS --> - <link href="../../core/libs/theme_engine/BootStrap/css/bootstrap.min.css" rel="stylesheet"> - <!-- Custom styles for this template --> - <link href="jumbotron.css" rel="stylesheet"> - - <script src="../../core/libs/theme_engine/BootStrap/js/bootstrap.min.js"></script> - <script src="../../core/libs/theme_engine/jquery/jquery-1.11.2.min.js"></script> - - <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> - <!--[if lt IE 9]> - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> - <![endif]--> -<script type="text/javascript"> - function showhide(id) { - if (document.getElementById) { - var divid = document.getElementById(id); - var divs = document.getElementsByClassName("hide_"); - for (var i = 0; i < divs.length; i++) { - divs[i].style.display = "none"; - } - divid.style.display = "block"; - } - return false; - } - - function foo() { - var divid1 = document.getElementById("bill"); - divid1.style.display = "block"; - } - onload = foo; -</script> -<style type="text/css"> -.bio_image { - display:inline-block; - height:250px; - width:250px; - background:url('http://www.fillmurray.com/250/250'); - cursor:pointer; -} -.hide_ { - display:none; -} -</style> -</head> -<body> -<div onclick="showhide('bill');" class="bio_image"><div class="name">Bill Murray</div></div> -<div onclick="showhide('bill2');" class="bio_image"><div class="name">Bill Murray</div></div> -<div onclick="showhide('bill3');" class="bio_image"><div class="name">Bill Murray</div></div> -<div class="hide_" id="bill">BILL</div> -<div class="hide_" id="bill2">BILL2</div> -<div class="hide_" id="bill3">BILL3</div> -</body> -</html> -\ No newline at end of file