Initial commit

This commit is contained in:
Gregory Soutade
2015-09-24 18:31:03 +02:00
commit 46082b8dcb
34 changed files with 4422 additions and 0 deletions

View File

@@ -0,0 +1,147 @@
div.logo {
margin-left:auto;
margin-right:auto;
text-align:center;
}
div.body
{
display:table;
}
div
{
display: block;
}
/* Left panel */
#left_panel
{
display : table-cell;
min-width : 20%;
padding-left : 1em;
padding-top : 2em;
/* display : inline-block; */
vertical-align: top;
}
#home_icon
{
padding-left:4em;
}
#left_panel div#categories
{
display : block;
background-image: url('/static/images/denote_border.png');
background-position: right;
background-repeat:repeat-y;
padding-right:20px;
}
#left_panel .edit_category
{
display:none;
visibility:hidden;
}
#left_panel div#categories div.name
{
font-size : 1.5em;
padding-top : 1em;
}
div#categories div.name img
{
display:inline;
padding-right:0.5em;
}
#left_panel div.note
{
display : block;
padding-top : 1em;
padding-left: 1em;
}
#left_panel div#categories a
{
color: black;
text-decoration: none;
font-weight: bold;
}
#left_panel .date, .summary
{
color:gray;
font-size: 0.8em;
font-style: italic;
}
.summary
{
color:black;
}
/* Main panel */
#main_panel
{
padding-top : 2em;
padding-left: 1em;
display:table-cell;
/* display : inline-block; */
vertical-align: top;
}
#edit_profile
{
font-size: 2em;
}
.settings
{
float:right; clear:right;
padding:1em;
}
#main_panel .note
{
margin : 1em;
}
#main_panel .note .title a
{
color: black;
text-decoration: none;
font-size: 1em;
}
#main_panel .date, .summary
{
color:gray;
font-size: 1em;
font-style: italic;
}
#form_delete
{
display:inline;
}
#div_edit
{
display:none;
visibility:hidden;
}
#main_panel .note .title
{
font-size:2em;
}
.edit_button
{
text-align:right;
}

View File

@@ -0,0 +1,62 @@
.hll { background-color: #ffffcc }
.c { color: #408080; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cp { color: #BC7A00 } /* Comment.Preproc */
.c1 { color: #408080; font-style: italic } /* Comment.Single */
.cs { color: #408080; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #7D9029 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #999999; font-weight: bold } /* Name.Entity */
.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #A0A000 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #666666 } /* Literal.Number.Bin */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #BB6688 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.il { color: #666666 } /* Literal.Number.Integer.Long */

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

175
denote/static/js/denote.js Normal file
View File

@@ -0,0 +1,175 @@
function setPreference(cname, cvalue) {
var params = "set=1" + "&name=" + cname + "&value=" + cvalue;
var req = new XMLHttpRequest();
req.open('POST', '/preferences', true);
req.setRequestHeader("X-CSRFToken", get_csrf_token());
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.onreadystatechange = function (aEvt) {
if (req.readyState == 4 && req.status != 200) {
alert('Error setting preference');
}
};
req.send(params);
}
function getPreference(cname) {
var params = "get=1" + "&name=" + cname;
var req = new XMLHttpRequest();
req.open('POST', '/preferences', false);
req.setRequestHeader("X-CSRFToken", get_csrf_token());
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.send(params);
if(req.status == 200)
return JSON.parse(req.responseText)[cname];
return null;
}
function set_visible(id, visible, display="block")
{
widget = document.getElementById(id);
if (visible)
{
widget.style.display = display;
widget.style.visibility = "visible";
}
else
{
widget.style.display = "none";
widget.style.visibility = "hidden";
}
return widget;
}
function updateHiddenCategories(cat_id, add)
{
if (hidden_categories == null)
hidden_categories = [];
for(i=0; i<hidden_categories.length; i++)
{
if (hidden_categories[i] == cat_id)
{
if (add) return;
hidden_categories.splice(i, 1);
break;
}
}
if (add)
hidden_categories.push(cat_id);
setPreference('hidden_categories', hidden_categories.join(","));
}
function hide_category(cat_id, update_cookie=true)
{
set_visible("content_" + cat_id, false);
set_visible("minus_" + cat_id, false);
set_visible("plus_" + cat_id, true, "inline-block");
if (update_cookie)
updateHiddenCategories(cat_id, true);
}
function show_category(cat_id, update_cookie=true)
{
set_visible("content_" + cat_id, true);
set_visible("minus_" + cat_id, true, "inline-block");
set_visible("plus_" + cat_id, false);
if (update_cookie)
updateHiddenCategories(cat_id, false);
}
function category_setup()
{
if (hidden_categories == null)
hidden_categories = [];
categories = document.getElementById("categories");
for(i=0; i<categories.childNodes.length; i++)
{
category = categories.childNodes[i];
if (category.nodeType != Node.ELEMENT_NODE) continue;
categoryId = category.getAttribute("category_id");
hide = false;
for(a=0; a<hidden_categories.length;a++)
{
if (hidden_categories[a] == categoryId)
{
hide = true;
break;
}
}
if (hide)
hide_category(categoryId, false);
else
show_category(categoryId, false);
}
}
function startup()
{
category_setup();
}
function edit_category(cat_id, name)
{
set_visible("category_" + cat_id, false);
set_visible("edit_category_" + cat_id, true);
input = document.getElementById("cat_name_" + cat_id);
input.value = name;
input.focus();
}
function end_edit_category(cat_id)
{
set_visible("category_" + cat_id, true);
set_visible("edit_category_" + cat_id, false);
}
function submit_category_name(cat_id, orig)
{
me = document.getElementById("cat_name_" + cat_id);
if (me.value.localeCompare(orig) != 0)
{
form = document.getElementById("edit_category_" + cat_id);
form.submit();
return true;
}
else
return false;
return false;
}
function handleKeyPress(e, cat_id, orig){
var key=e.keyCode || e.which;
if (key==13)
submit_category_name(cat_id, orig);
}
function edit_note()
{
document.body.scrollTop = document.documentElement.scrollTop = 0;
set_visible("title", false);
set_visible("transformed_content", false);
set_visible("edit_button", false);
set_visible("form_delete", false);
set_visible("div_edit", true);
}
function cancel_edit_note()
{
document.body.scrollTop = document.documentElement.scrollTop = 0;
set_visible("title", true);
set_visible("transformed_content", true);
set_visible("edit_button", true, "inline");
set_visible("form_delete", true, "inline");
set_visible("div_edit", false);
}