-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTest.html
More file actions
69 lines (57 loc) · 2.17 KB
/
Test.html
File metadata and controls
69 lines (57 loc) · 2.17 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
<!DOCTYPE html>
<html>
<head>
<style>
.source {
width:300px;
height:100px;
}
.codeCompleteEditor {
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.codecomplete.js"></script>
<script>
/*var model = {
"keywords": [ { name: 'if', type: 'syntax' }, { name: 'else', type: 'syntax' }, { name: 'firstname', type: 'string' }, { name: 'age', type: 'int' }, { name: 'description', type: 'string' }, { name: 'documentcode', type: 'documentcode' }, { name: 'packet', type: 'packet' } ],
"dataTypes": [ { type: 'string', methods: [ 'tostring', 'toupper', 'tolower' ] }, { type: 'int', methods: [ 'tostring' ] }, { type: 'documentcode', methods: [ 'I9', 'W2', 'DirectDeposit' ] }, { type: 'packet', methods: [ 'add' ] } ]
};*/
jQuery.ajax({
url: 'http://localhost:62619/CodeComplete/GetModel',
data: { dataSourceName: 'Enrollment', packetCode: 'DEBPACKET', packetVersion: 3 },
dataType: "jsonp",
crossDomain: true,
success: function(data) {
//jQuery("#source").codeComplete(data);
jQuery("#code").codeComplete(data);
},
error: function (response) {
alert(response.status);
}
});
$(document).ready(function() {
//jQuery("textarea").width(300).height(300).first().focus();
//jQuery("#source").codeComplete(model);
jQuery("#code").width(300).height(300).first().focus();
$("#submit").bind("click", function() {
alert($("#code").text());
});
$("#insert").bind("click", function() {
document.execCommand("insertHTML", false, "<select id='matches' style='top:15px'><option>Select One...</option></select>");
});
if (window.localStorage)
log("localStorage Available!");
else
log("localStorage Not Available.");
});
</script>
</head>
<body>
<!-- <textarea id='source' class="source"></textarea>
<div id='trace' />
<br/><br/> -->
<textarea id="code" class="codeCompleteEditor"></textarea>
<input type="button" id="submit" value="See Markup" />
<input type="button" id="insert" value="Insert Select" />
</body>
</html>