This repository was archived by the owner on Feb 18, 2023. It is now read-only.
forked from derobins/wmd
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathin-place-editing.html
More file actions
71 lines (58 loc) · 3.26 KB
/
in-place-editing.html
File metadata and controls
71 lines (58 loc) · 3.26 KB
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>MarkEdit In Place Editing Example</title>
<link rel="stylesheet" type="text/css" href="../jquery.markedit.css" />
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css" />
<style type="text/css">
p.hover { cursor: pointer; background-color: pink; color: black; }
div.dialog { font-size: 0.75em; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="../showdown.js"></script>
<script type="text/javascript" src="../jquery.markedit.js"></script>
<script type="text/javascript">
// On page load...
$(function(){
$('p').each(function() {
$(this).mouseover(function() {
$(this).addClass('hover');
});
$(this).mouseout(function() {
$(this).removeClass('hover');
});
$(this).click(function(){
var pTag = $(this);
var textarea = $('<textarea style="height:300px"></textarea>');
var win = $('<div class="dialog"></div>');
$(textarea).html($(pTag).html());
$(win).append(textarea);
$(win).dialog({
'title': 'Edit',
'autoshow': true,
'height': 500,
'width': 800,
'buttons': {
'Save': function() {
var html = $(textarea).markeditGetHtml();
$(pTag).html(html);
$(win).dialog('close');
},
'Cancel' : function() {
$(win).dialog('close');
},
}
});
$(textarea).markedit();
});
});
})
</script>
</head>
<body>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<p>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Whatever</p>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.</p>
</body>
</html>