-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
142 lines (116 loc) · 4.67 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
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
<!-- main page for data_integrator frontend -->
<html>
<head>
<!--
TODO: Check out Browserify
-->
<script type="text/javascript" src="./js/app_bundle.js"></script>
<!--
<script type="text/javascript" src="./js/require.js"></script>
<script type="text/javascript">
var smoothie = {
'requirePaths': [
'./node_modules',
'./classes',
'./widgets']
};
</script>
-->
<script type="text/javascript" src="./js/jquery-1.11.0.min.js"></script>
<!--<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>-->
<script type="text/javascript" src="./ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="./ckeditor/adapters/jquery.js"></script>
<script src="https://hackpad.com/static/hackpad.js"/>
<script src="js/bootstrap.min.js"></script>
<script src="./js/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="js/raphael-min.js"></script>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/integrator.css" rel="stylesheet">
<!--<script src="widgets/templaterenderer/widget.templaterenderer.class.js"></script> -->
<!-- <script src="classes/thing/thing.js"></script> -->
<script type="text/javascript" language="javascript">
var IAMONTHECLIENT = true;
console.log("getting started");
var GLOBAL = {};
GLOBAL.context = "client";
GLOBAL.params = {};
GLOBAL.params.root_dir = ".";
GLOBAL.params.require_prefix = "";
GLOBAL.$= $;
GLOBAL.$(document).ready(function(){
console.log("loaded and ready");
var container = document.querySelector('#maincontainer');
var msnry = new Masonry( container, {
// options
columnWidth: 200,
itemSelector: '.item'
});
// bootstrap-ckeditor-modal-fix.js
// hack to fix ckeditor/bootstrap compatiability bug when ckeditor appears in a bootstrap modal dialog
//
// Include this AFTER both bootstrap and ckeditor are loaded.
// From: http://stackoverflow.com/questions/14420300/bootstrap-with-ckeditor-equals-problems
// Author: http://stackoverflow.com/users/185839/aaron
GLOBAL.$(".editor").ckeditor(function(elem){
console.log("editor loaded");
GLOBAL.$.fn.modal.Constructor.prototype.enforceFocus = function() {
modal_this = this
GLOBAL.$(document).on('focusin.modal', function (e) {
if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length
&& !$(e.target.parentNode).hasClass('cke_dialog_ui_input_select')
&& !$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) {
modal_this.$element.focus()
}
})
};
});
var async = require("async");
var urlparser = require("urlparser");
// var entityManager = require("./classes/entity/entity.js").EntityManager();
var entityManager = require(GLOBAL.params.require_prefix+"/classes/entity/entity.js").EntityManager();
var renderer = require(GLOBAL.params.require_prefix+"/classes/renderer/renderer.js").RenderManager();
var parsed = urlparser.parse(location.href, true);
console.log(parsed);
var entityId = parsed.query.parts[0];
console.log(entityId);
function callback(entity){
console.log("in final callback");
renderer.renderEntityEditable(entity, $(".navbar"), $(".mainview"));
}
entityManager.generateEntity(entityId, callback);
console.log("done");
});
</script>
</head>
<body style="padding-top: 70px;">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Integrator</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<!-- <li class="actionButton"><a class="actionLabel" >Entity Action 1</a></li> -->
<li class="actionDropdown">
<a href="#" class="dropdown-toggle actionLabel" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a class="entityDescriptor">Default</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div id="maincontainer" class="container mainview">
</div>
</body>
</html>