Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
yjs
Commits
ecd412c6
Commit
ecd412c6
authored
8 years ago
by
Kevin Jahns
Browse files
Options
Downloads
Patches
Plain Diff
sourcedir is no longer a global variable
parent
b939cdd0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/y.js
+4
-4
4 additions, 4 deletions
src/y.js
with
4 additions
and
4 deletions
src/y.js
+
4
−
4
View file @
ecd412c6
...
@@ -26,7 +26,8 @@ Y.extend = function (name, value) {
...
@@ -26,7 +26,8 @@ Y.extend = function (name, value) {
}
}
Y
.
requestModules
=
requestModules
Y
.
requestModules
=
requestModules
function
requestModules
(
modules
)
{
function
requestModules
(
modules
,
sourceDir
)
{
sourceDir
=
sourceDir
||
'
/bower_components
'
// determine if this module was compiled for es5 or es6 (y.js vs. y.es6)
// determine if this module was compiled for es5 or es6 (y.js vs. y.es6)
// if Insert.execute is a Function, then it isnt a generator..
// if Insert.execute is a Function, then it isnt a generator..
// then load the es5(.js) files..
// then load the es5(.js) files..
...
@@ -40,7 +41,7 @@ function requestModules (modules) {
...
@@ -40,7 +41,7 @@ function requestModules (modules) {
// module does not exist
// module does not exist
if
(
typeof
window
!==
'
undefined
'
&&
window
.
Y
!==
'
undefined
'
)
{
if
(
typeof
window
!==
'
undefined
'
&&
window
.
Y
!==
'
undefined
'
)
{
var
imported
=
document
.
createElement
(
'
script
'
)
var
imported
=
document
.
createElement
(
'
script
'
)
imported
.
src
=
Y
.
sourceDir
+
'
/
'
+
modulename
+
'
/
'
+
modulename
+
extention
imported
.
src
=
sourceDir
+
'
/
'
+
modulename
+
'
/
'
+
modulename
+
extention
document
.
head
.
appendChild
(
imported
)
document
.
head
.
appendChild
(
imported
)
let
requireModule
=
{}
let
requireModule
=
{}
...
@@ -96,10 +97,9 @@ function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
...
@@ -96,10 +97,9 @@ function Y (opts/* :YOptions */) /* :Promise<YConfig> */ {
for
(
var
name
in
opts
.
share
)
{
for
(
var
name
in
opts
.
share
)
{
modules
.
push
(
opts
.
share
[
name
])
modules
.
push
(
opts
.
share
[
name
])
}
}
Y
.
sourceDir
=
opts
.
sourceDir
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
Y
.
requestModules
(
modules
).
then
(
function
()
{
Y
.
requestModules
(
modules
,
opts
.
sourceDir
).
then
(
function
()
{
if
(
opts
==
null
)
reject
(
'
An options object is expected!
'
)
if
(
opts
==
null
)
reject
(
'
An options object is expected!
'
)
else
if
(
opts
.
connector
==
null
)
reject
(
'
You must specify a connector! (missing connector property)
'
)
else
if
(
opts
.
connector
==
null
)
reject
(
'
You must specify a connector! (missing connector property)
'
)
else
if
(
opts
.
connector
.
name
==
null
)
reject
(
'
You must specify connector name! (missing connector.name property)
'
)
else
if
(
opts
.
connector
.
name
==
null
)
reject
(
'
You must specify connector name! (missing connector.name property)
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment