-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
63 lines (63 loc) · 1.98 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<title>jQuery+RequireJS Sample Page</title>
<!-- This is a special version of jQuery with RequireJS built-in -->
<script src="deps/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl: "/_browser/aloha/src/lib",
paths: {
"karacos": "/_browser/karacos-ui"
},
waitSeconds: 15,
locale: "fr-fr"
});
require(["order!karacos/jquery","order!karacos/main"],function(){
require.ready(function(){
var
scriptEl,
appendEl = document.head || document.getElementsByTagName('head')[0];
// TODO: without this line, duplicate jQuery (and jQ plugins)
// window.alohaQuery = jQuery;
// TODO : with this line, problem with jQuery.promise ... Disabling for now
scriptEl = document.createElement('link');
scriptEl.rel = 'stylesheet';
scriptEl.href = '/_browser/aloha/src/css/aloha.css';
scriptEl.id = 'aloha-style-include';
scriptEl.setAttribute('type','text/css'); // */
appendEl.appendChild(scriptEl);
$('body').append('<div style="display: none"> <img src="/_browser/aloha/src/require.js" data-aloha-plugins="common/format"/></div>');
require(['aloha'], function() {
kcQuery('body').bind('aloha',function(){
console.log("activating editor for semantic entity");
kcQuery('[typeof][about]').find("[property]").aloha();
});
});
});
});
</script>
</head>
<body>
<h1>jQuery+RequireJS Sample Page</h1>
<p>Look at source or inspect the DOM to see how it works.</p>
<div typeof="urn:uuid:toto" about="me">
<div property="title">Le titre</div>
</div>
</body>
<script>
require(["karacos/jquery"],function(){
$('body').bind('karacosCoreLoaded', function(){
KaraCos({
fqdn: 'local.nka.me:65080',
page_url: '/',
page_id: '3423535343',
main_content: "#main",
page_base_id: '231242432353523',
auth: {
}
});
console.log("event catched in page");
});
});</script>
</html>