-
Notifications
You must be signed in to change notification settings - Fork 18
/
edit.php
executable file
·161 lines (140 loc) · 7.25 KB
/
edit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
require_once dirname(__FILE__).'/include/user.php';
require_once dirname(__FILE__).'/include/note.php';
if(!hasLogin()){
echo 'Please login';
exit();
}
if( hasLogin() && isset($_POST['action']) && $_POST['action'] == 'getNotelist' ){
$theNotebooks = getUserNotebooks($USERNAME);
// var_dump($theNotebooks);
foreach ($theNotebooks as $value) {
if(is_int($value)){
?>
<div id="notelist-item-<?php echo $value?>" class="notelist-item notelist-item-single" title="<?php echo getNoteTitle($value); ?>" onclick="loadNote(<?php echo $value?>);"><i class="fa fa-file-text" aria-hidden="true"></i><?php echo getNoteTitle($value); ?></div>
<?php
}
if(is_array($value)){
?>
<div class="notelist-item-single" style="height: 1px;"></div>
<div class="notelist-folder">
<i class="fa fa-angle-down fa-lg i-notelist-folder-arrow" aria-hidden="true"></i>
<div class="notelist-item notebook-opened notelist-item-notebook-title" onclick="toggleNotebook(this);"><i class="fa fa-book" aria-hidden="true"></i><?php echo $value[0]; ?></div>
<?php
foreach ($value as $note) {
if(is_int($note)){
?>
<div id="notelist-item-<?php echo $note?>" class="notelist-item notelist-item-subnote" title="<?php echo getNoteTitle($note); ?>" onclick="loadNote(<?php echo $note?>);"><i class="fa fa-file-text" aria-hidden="true"></i><?php echo getNoteTitle($note); ?></div>
<?php
}
}
?>
<div class="notelist-item notelist-item-subnote2" onclick="newSubnote('<?php echo $value[0]; ?>');">
<i class="fa fa-plus" aria-hidden="true"></i>
New Note
</div>
</div><?php
}
}
?>
<div class="notelist-item-single" style="height: 1px;"></div>
<div class="notelist-item" onclick="newNote();">
<i class="fa fa-plus" aria-hidden="true"></i>
New Note
</div>
<div class="notelist-item" onclick="newNotebook();">
<i class="fa fa-plus" aria-hidden="true"></i>
New Notebook
</div>
<?php
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MarkNote</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="//cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
<script src="//cdn.bootcss.com/marked/0.3.6/marked.min.js"></script>
<script src="//cdn.bootcss.com/ace/1.2.5/ace.js"></script>
<!-- <script src="//cdn.bootcss.com/prism/0.0.1/prism.min.js"></script> -->
<!-- <script src="//cdn.bootcss.com/mathjax/2.5.3/MathJax.js"></script> -->
<script src="//cdn.bootcss.com/mathjax/2.6.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script src="//cdn.bootcss.com/Sortable/1.4.2/Sortable.min.js"></script>
<script src="include/js/edit.js"></script>
<script src="include/js/prism.js"></script>
<link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet">
<link href="//cdn.bootcss.com/octicons/3.5.0/octicons.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="include/css/edit.css">
<link rel="stylesheet" type="text/css" href="include/css/prism.css">
</head>
<body>
<div id="header">
<h1 id="header-title">MarkNote</h1>
<div id="header-user">
<div id="header-user-head">
<i class="fa fa-user fa-2x" aria-hiddem="true" style="margin: 7px 0px 0px 5px;"></i>
</div>
<span id="header-user-name"><?php echo $USERNAME; ?></span>
<span id="header-user-emailandlogout"><?php echo getUserEmail($USERNAME); ?> | <a style="cursor: pointer;" onclick="$('#header-user-logoutform').submit();">logout</a></span>
<form id="header-user-logoutform" method="post" action="login.php">
<input type="hidden" name="type" value="logout">
</form>
</div>
</div>
<div id="content">
<div id="toolbar">
<div class="toolbar-icon" title="New Note" onclick="newNoteBelow()" style="padding-left: 17px;"><span class="octicon octicon-file-text" style="font-size: 19px;"></span></span></div>
<div class="toolbar-icon" title="New Notebook" onclick="newNotebook()"><span class="octicon octicon-file-directory"></span></div>
<div class="toolbar-icon" title="Save" onclick="saveNote()"><i class="fa fa-lg fa-floppy-o" aria-hidden="true"></i></div>
<div class="toolbar-icon" title="Search" onclick="EditorAce.config.loadModule('ace/ext/searchbox');" style="padding-left: 14px;"><span class="octicon octicon-search"></span></div>
<div class="toolbar-icon" title="Settings" onclick=""><span class="octicon octicon-gear"></span></div>
</div>
<div id="sidebar">
<div id="sidebar-status">Status: <span id="sidebar-status-icon">●</span> <span id="sidebar-status-text">page loding...</span></div>
<div id="sidebar-notelist">load</div>
</div>
<div id="editor">
<div id="editor-ace"># Welcome to Marknote
Please select a __note__ in the list on the left.</div>
<div id="editor-move"></div>
<div id="editor-show"></div>
<div id="editor-show-preprocess"></div>
</div>
</div>
<div id="contextmenu-1" class="contextmenu">
<div class="contextmenu-item" onclick="noteContextClick('open');"> <i class="fa fa-file" aria-hidden="true"></i> Open</div>
<div class="contextmenu-item" onclick="noteContextClick('rename');"> <i class="fa fa-edit" aria-hidden="true"></i> Rename</div>
<div class="contextmenu-item" onclick="noteContextClick('clone');"> <i class="fa fa-clone" aria-hidden="true"></i> Clone</div>
<!-- <div class="contextmenu-item" onclick="noteContextClick('share');"> <i class="fa fa-share-alt" aria-hidden="true"></i> Share</div> -->
<!-- <div class="contextmenu-item" onclick="noteContextClick('export');"> <i class="fa fa-external-link " aria-hidden="true"></i> Export</div> -->
<div class="contextmenu-item" onclick="noteContextClick('delete');"> <i class="fa fa-trash" aria-hidden="true"></i> Delete</div>
<div class="contextmenu-item" onclick="noteContextClick('properties');"> <i class="fa fa-info-circle" aria-hidden="true"></i> Properties</div>
</div>
<div id="contextmenu-2" class="contextmenu">
<div class="contextmenu-item"><i class="fa fa-file" aria-hidden="true"></i> Open</div>
<div class="contextmenu-item"><i class="fa fa-edit" aria-hidden="true"></i> Rename</div>
<div class="contextmenu-item"><i class="fa fa-clone" aria-hidden="true"></i> Clone</div>
<div class="contextmenu-item"><i class="fa fa-share-alt" aria-hidden="true"></i> Share</div>
<div class="contextmenu-item"><i class="fa fa-trash" aria-hidden="true"></i> Delete</div>
</div>
<div id="page-glass" onclick="hideProperties();"></div>
<div id="sidebar-properties">
<div id="sidebar-properties-header">
<i class="fa fa-file-text fa-3x" aria-hidden="true"></i>
<span id="sidebar-properties-header-notename">notename</span>
<span id="sidebar-properties-header-notetype">notetype</span>
</div>
<div id="sidebar-properties-body">
<span class="sidebar-properties-body-lable">Note name </span><span id="sidebar-properties-body-name"></span><br>
<span class="sidebar-properties-body-lable">Last modify </span><span id="sidebar-properties-body-lastmodify"></span><br>
<span class="sidebar-properties-body-lable">Last access </span><span id="sidebar-properties-body-lastaccess"></span><br>
</div>
</div>
<input id="float-input" type="text">
<div id="float-notsaved-lable">●</div>
</body>
</html>