Fix up UI and assorted fixes

feature/core
Sven Slootweg 11 years ago
parent 90dc19c748
commit 7025e34054

@ -0,0 +1,18 @@
<?php
/*
* projectname is more free software. It is licensed under the WTFPL, which
* allows you to do pretty much anything with it, without having to
* ask permission. Commercial use is allowed, and no attribution is
* required. We do politely request that you share your modifications
* to benefit other developers, but you are under no enforced
* obligation to do so :)
*
* Please read the accompanying LICENSE document for the full WTFPL
* licensing text.
*/
if(!isset($_APP)) { die("Unauthorized."); }
$sData = array(
"contents" => NewTemplater::Render("static/intro", $locale->strings, array())
);

@ -14,6 +14,8 @@
$_APP = true;
require("includes/base.php");
$sData = array();
$router = new CPHPRouter();
$router->ignore_query = true;
@ -22,8 +24,17 @@ $router->allow_slash = true;
$router->routes = array(
0 => array(
"^/$" => "modules/index.php",
"^/editor$" => "modules/editor.php"
"^/editor$" => "modules/editor.php",
"^/intro$" => array(
'target' => "modules/intro.php",
'_json' => true
),
)
);
$router->RouteRequest();
if(!empty($router->uVariables['json']))
{
echo(json_encode($sData));
}

@ -0,0 +1,90 @@
#main_toolbar, #main_toolbar button
{
font-family: "Istok Web";
}
#main_toolbar
{
padding: 36px 24px;
}
form.inline
{
display: inline;
}
#form_search
{
float: left;
margin-left: 12px;
}
#form_search input, #form_search button
{
height: 37px;
}
#form_search input
{
margin-left: 12px;
font-size: 16px;
padding: 7px 14px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
width: 290px;
}
#form_search button
{
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
#main_toolbar a.add
{
float: left;
}
.pure-button
{
padding: 7px 14px;
}
.pure-button.shadow
{
text-shadow: 1px 1px 1px #424242;
-webkit-text-shadow: 1px 1px 1px #424242;
-moz-text-shadow: 1px 1px 2px #424242;
-o-text-shadow: 1px 1px 1px #424242;
-ms-text-shadow: 1px 1px 1px #424242;
}
.pure-button.add
{
background-color: #15BA31;
color: white;
}
.pure-button.search
{
background-color: #152DBA;
color: white;
}
.pure-button i
{
margin-right: 8px;
position: relative;
top: 1px;
}
.element-group
{
display: block;
float: left;
}
.element-group *
{
float: left;
}

@ -0,0 +1,58 @@
function hookSubmitEvent(form, callback, error)
{
/* Hooks a form to be submitted via AJAX, executing the given
* callback if the request succeeds.
*
* form: a jQuery object containing one or more form elements
* callback: the function to run after a successful request
* error: optionally, a callback function to run when the
* request fails
*/
form.each(function(index){
var element = $(this);
var method = element.attr("method").toUpperCase();
var target = element.attr("action");
element.submit(function(){
var formdata = element.serialize();
console.log(formdata);
$.ajax({
type: method,
url: target,
data: formdata,
success: callback,
error: error
});
return false;
});
});
}
$(function(){
hookSubmitEvent($("#form_addnode"));
$("#button_toolbar_addnode").click(function(){
new JsdeWindow({
width: 320,
height: 400,
x: 40,
y: 40,
title: "Create new node",
contents: "Loading...",
source_url: "/nodes/create"
});
});
/* Intro screen */
new JsdeWindow({
width: 640,
height: 480,
x: ($(window).width() / 2) - (640 / 2),
y: ($(window).height() / 2) - (480 / 2),
title: "Welcome!",
contents: "Loading...",
source_url: "/intro"
});
});

@ -6,6 +6,7 @@
<link rel="stylesheet" href="/static/css/jsde.style.css">
<script src="/static/js/jquery-1.10.2.min.js"></script>
<script src="/static/js/jsde.js"></script>
<script src="/static/js/openng.js"></script>
<style>
body
{
@ -30,23 +31,25 @@
-ms-text-shadow: 0px 0px 1px #CEE3F9;
}
</style>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Istok+Web:400,700">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Varela+Round">
<script>
$(function(){
new JsdeWindow({
width: 640,
height: 480,
x: ($(window).width() / 2) - (640 / 2),
y: ($(window).height() / 2) - (480 / 2),
title: "Welcome!",
contents: "Some kind of introduction should probably go here..."
});
});
</script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css">
<link rel="stylesheet" href="/static/css/openng.css">
</head>
<body>
<div id="main_toolbar">
<a href="#" class="pure-button add shadow" id="button_toolbar_addnode"><i class="icon-plus"></i>Create new node</a>
<form class="pure-form inline" id="form_search" method="post" action="/search">
<span class="element-group">
<input type="text" id="input_search_query" name="query" value="" placeholder="Enter something to search for...">
<button type="submit" class="pure-button search shadow"><i class="icon-search"></i>Search</button>
<div class="clear"></div>
</span>
</form>
</div>
<div id="logo">openNG</div>
<!-- <div class="workspace-bar">
<span id="workspace-tab-list">
@ -58,7 +61,7 @@
<div class="template_window window-wrapper window-styled">
<div class="window-title">
<span class="window-title-inner">
Test title
</span>
<div class="window-close">
<a href="#">X</a>
@ -66,12 +69,11 @@
</div>
<div class="window-outer">
<div class="window-inner">
<strong>Test contents</strong>
</div>
<div class="window-resizer">
</div>
</div>
<input type="hidden" name="MDIWindowIdentifier" value="1" class="MDIWindowIdentifier">
</div>
</div>
</body>

@ -0,0 +1 @@
A brief explanation of openNG will be added here.
Loading…
Cancel
Save