-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.html
85 lines (71 loc) · 3.32 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OneDrive Markdown Editor Sample</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.min.css">
<link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.components.min.css">
<link rel="stylesheet" href="css/custom.style.css">
<script text="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script>
<!-- Include the OneDrive SDK from CDN https://js.live.net/v7.2/OneDrive.js -->
<script type="text/javascript" src="https://js.live.net/v7.2/OneDrive.js"></script>
</head>
<body>
<script>
// Redirect to HTTPS when not running on localhost, so that the redirect URI works for auth
if ((!window.location.host.startsWith("localhost")) && (window.location.protocol != "https:")) {
window.location.protocol = "https";
}
</script>
<!-- Office Fabric UI NavBar -->
<div class="ms-NavBar">
<div class="ms-NavBar-openMenu js-openMenu"></div>
<ul class="ms-NavBar-items">
<li class="ms-NavBar-item">
<!-- Create new button -->
<a class="ms-NavBar-link" href="#" id="newFileCommand"><i class="ms-Icon ms-Icon--document"></i> Create New</a>
</li>
<li class="ms-NavBar-item">
<!-- Open Button to invoke the open picker -->
<a class="ms-NavBar-link" href="#" id="openFileCommand"><i class="ms-Icon ms-Icon--folder"></i> Open</a>
</li>
<li class="ms-NavBar-item">
<!-- Save button to save back without invoking the picker -->
<a class="ms-NavBar-link" href="#" id="saveFileCommand"><i class="ms-Icon ms-Icon--save"></i> Save</a>
</li>
<li class="ms-NavBar-item">
<!-- Save As button to invoke the picker in save mode -->
<a class="ms-NavBar-link" href="#" id="saveAsFileCommand">Save As</a>
</li>
<li class="ms-NavBar-item">
<!-- Get a link button to call Graph API -->
<a class="ms-NavBar-link" href="#" id="shareFileCommand">Get Link</a>
</li>
<li class="ms-NavBar-item">
<!-- Current item filename, which you can click to change -->
<a class="ms-NavBar-link" href="#" id="renameFileCommand"></a>
</li>
<li class="ms-NavBar-item ms-NavBar-item--right">
<a class="ms-NavBar-link" href="https://github.com/rgregg/onedrive-texteditor-js">View Code</a>
</li>
</ul>
</div>
<div class="textEditor">
<!-- Space for the text editor to live -->
<textarea id="canvas"></textarea>
</div>
<script text="text/javascript" src="js/markdown-editor.js"></script>
<script type="text/javascript">
$(document).ready(function () {
markdownEditor.wireUpCommandButton($("#newFileCommand")[0], "new");
markdownEditor.wireUpCommandButton($("#openFileCommand")[0], "open");
markdownEditor.wireUpCommandButton($("#saveFileCommand")[0], "save");
markdownEditor.wireUpCommandButton($("#saveAsFileCommand")[0], "saveAs");
markdownEditor.wireUpCommandButton($("#renameFileCommand")[0], "rename");
markdownEditor.wireUpCommandButton($("#shareFileCommand")[0], "share");
})
</script>
</body>
</html>