MCPcopy
hub / github.com/ternjs/tern / initProject

Function initProject

doc/demo/demo.js:170–192  ·  view source on GitHub ↗
(name, c)

Source from the content-addressed store, hash-verified

168}
169
170function initProject(name, c) {
171 var node = document.getElementById(name)
172 loadDefs(words(node.getAttribute("data-libs")), function(defs) {
173 var plugins = {}
174 words(node.getAttribute("data-plugins")).forEach(function(name) { plugins[name] = true })
175
176 if (plugins.requirejs) plugins.requirejs = {override: {"jquery": "=$"}}
177
178 loadFiles(node, function(files) {
179 var place = document.getElementById("place")
180 place.textContent = ""
181
182 if (project) project.server.destroy()
183
184 project = new Project(name, place, {
185 defs: defs,
186 plugins: plugins
187 }, files)
188 location.hash = "#" + name
189 c && c()
190 })
191 })
192}
193
194var commands = {
195 complete: function() { project.server.complete(project.editor) },

Callers 2

demo.jsFile · 0.85
updateFromHashFunction · 0.85

Calls 4

loadDefsFunction · 0.85
wordsFunction · 0.85
loadFilesFunction · 0.85
cFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…