Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
morpheus.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Daria Zenkova
morpheus.js
Commits
c8bae63e
Commit
c8bae63e
authored
Jun 07, 2016
by
Joshua Gould
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
paste
parent
b47362de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
47 deletions
+52
-47
js/morpheus-latest.min.js
js/morpheus-latest.min.js
+4
-4
src/landing_page.js
src/landing_page.js
+48
-43
No files found.
js/morpheus-latest.min.js
View file @
c8bae63e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/landing_page.js
View file @
c8bae63e
morpheus
.
LandingPage
=
function
(
pageOptions
)
{
morpheus
.
LandingPage
=
function
(
pageOptions
)
{
pageOptions
=
$
.
extend
({},
{
pageOptions
=
$
.
extend
({},
{
el
:
$
(
'
#vis
'
)
el
:
$
(
'
#vis
'
)
},
pageOptions
);
},
pageOptions
);
this
.
pageOptions
=
pageOptions
;
this
.
pageOptions
=
pageOptions
;
var
_this
=
this
;
var
_this
=
this
;
...
@@ -23,12 +23,12 @@ morpheus.LandingPage = function(pageOptions) {
...
@@ -23,12 +23,12 @@ morpheus.LandingPage = function(pageOptions) {
new
morpheus
.
HelpMenu
().
$el
.
appendTo
(
$el
.
find
(
'
[name=help]
'
));
new
morpheus
.
HelpMenu
().
$el
.
appendTo
(
$el
.
find
(
'
[name=help]
'
));
var
formBuilder
=
new
morpheus
.
FormBuilder
();
var
formBuilder
=
new
morpheus
.
FormBuilder
();
formBuilder
.
append
({
formBuilder
.
append
({
name
:
'
file
'
,
name
:
'
file
'
,
showLabel
:
false
,
showLabel
:
false
,
value
:
''
,
value
:
''
,
type
:
'
file
'
,
type
:
'
file
'
,
required
:
true
,
required
:
true
,
help
:
morpheus
.
DatasetUtil
.
DATASET_FILE_FORMATS
help
:
morpheus
.
DatasetUtil
.
DATASET_FILE_FORMATS
});
});
formBuilder
.
$form
.
appendTo
(
$el
.
find
(
'
[name=formRow]
'
));
formBuilder
.
$form
.
appendTo
(
$el
.
find
(
'
[name=formRow]
'
));
this
.
formBuilder
=
formBuilder
;
this
.
formBuilder
=
formBuilder
;
...
@@ -37,23 +37,23 @@ morpheus.LandingPage = function(pageOptions) {
...
@@ -37,23 +37,23 @@ morpheus.LandingPage = function(pageOptions) {
};
};
morpheus
.
LandingPage
.
prototype
=
{
morpheus
.
LandingPage
.
prototype
=
{
dispose
:
function
()
{
dispose
:
function
()
{
this
.
formBuilder
.
setValue
(
'
file
'
,
''
);
this
.
formBuilder
.
setValue
(
'
file
'
,
''
);
this
.
$el
.
hide
();
this
.
$el
.
hide
();
$
(
window
)
$
(
window
)
.
off
(
.
off
(
'
paste.morpheus drop.morpheus dragover.morpheus dragenter.morpheus beforeunload.morpheus
'
);
'
paste.morpheus drop.morpheus dragover.morpheus dragenter.morpheus beforeunload.morpheus
'
);
$
(
window
).
on
(
'
beforeunload.morpheus
'
,
function
()
{
$
(
window
).
on
(
'
beforeunload.morpheus
'
,
function
()
{
return
'
Are you sure you want to close Morpheus?
'
;
return
'
Are you sure you want to close Morpheus?
'
;
});
});
this
.
formBuilder
.
off
(
'
change
'
);
this
.
formBuilder
.
off
(
'
change
'
);
},
},
show
:
function
()
{
show
:
function
()
{
var
_this
=
this
;
var
_this
=
this
;
if
(
!
this
.
sampleDatasets
)
{
if
(
!
this
.
sampleDatasets
)
{
this
.
sampleDatasets
=
new
morpheus
.
SampleDatasets
({
this
.
sampleDatasets
=
new
morpheus
.
SampleDatasets
({
$el
:
this
.
$sampleDatasetsEl
,
$el
:
this
.
$sampleDatasetsEl
,
callback
:
function
(
heatMapOptions
)
{
callback
:
function
(
heatMapOptions
)
{
_this
.
open
(
heatMapOptions
);
_this
.
open
(
heatMapOptions
);
}
}
});
});
...
@@ -61,27 +61,33 @@ morpheus.LandingPage.prototype = {
...
@@ -61,27 +61,33 @@ morpheus.LandingPage.prototype = {
this
.
$el
.
show
();
this
.
$el
.
show
();
this
.
formBuilder
.
on
(
'
change
'
,
function
(
e
)
{
this
.
formBuilder
.
on
(
'
change
'
,
function
(
e
)
{
var
value
=
e
.
value
;
var
value
=
e
.
value
;
if
(
value
!==
''
&&
value
!=
null
)
{
if
(
value
!==
''
&&
value
!=
null
)
{
_this
.
openFile
(
value
);
_this
.
openFile
(
value
);
}
}
});
});
$
(
window
).
on
(
'
paste.morpheus
'
,
function
(
e
)
{
$
(
window
).
on
(
'
paste.morpheus
'
,
function
(
e
)
{
var
tagName
=
e
.
target
.
tagName
;
if
(
tagName
==
'
INPUT
'
||
tagName
==
'
SELECT
'
||
tagName
==
'
TEXTAREA
'
)
{
return
;
}
var
text
=
e
.
originalEvent
.
clipboardData
.
getData
(
'
text/plain
'
);
var
text
=
e
.
originalEvent
.
clipboardData
.
getData
(
'
text/plain
'
);
if
(
text
!=
null
&&
text
.
length
>
0
)
{
if
(
text
!=
null
&&
text
.
length
>
0
)
{
var
blob
=
new
Blob
([
text
]);
var
blob
=
new
Blob
([
text
]);
var
url
=
window
.
URL
.
createObjectURL
(
blob
);
var
url
=
window
.
URL
.
createObjectURL
(
blob
);
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
_this
.
openFile
(
url
);
_this
.
openFile
(
url
);
}
}
}).
on
(
'
dragover.morpheus dragenter.morpheus
'
,
function
(
e
)
{
}).
on
(
'
dragover.morpheus dragenter.morpheus
'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
}).
on
(
}).
on
(
'
drop.morpheus
'
,
'
drop.morpheus
'
,
function
(
e
)
{
function
(
e
)
{
if
(
e
.
originalEvent
.
dataTransfer
if
(
e
.
originalEvent
.
dataTransfer
&&
e
.
originalEvent
.
dataTransfer
.
files
.
length
)
{
&&
e
.
originalEvent
.
dataTransfer
.
files
.
length
)
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -96,7 +102,7 @@ morpheus.LandingPage.prototype = {
...
@@ -96,7 +102,7 @@ morpheus.LandingPage.prototype = {
}
}
});
});
},
},
open
:
function
(
options
)
{
open
:
function
(
options
)
{
this
.
dispose
();
this
.
dispose
();
if
(
this
.
heatmap
==
null
)
{
if
(
this
.
heatmap
==
null
)
{
options
.
landingPage
=
this
;
options
.
landingPage
=
this
;
...
@@ -108,21 +114,20 @@ morpheus.LandingPage.prototype = {
...
@@ -108,21 +114,20 @@ morpheus.LandingPage.prototype = {
new
morpheus
.
HeatMap
(
options
);
new
morpheus
.
HeatMap
(
options
);
}
}
},
},
openFile
:
function
(
value
)
{
openFile
:
function
(
value
)
{
var
_this
=
this
;
var
_this
=
this
;
var
options
=
{
var
options
=
{
dataset
:
value
dataset
:
value
};
};
var
fileName
=
morpheus
.
Util
.
getFileName
(
value
);
var
fileName
=
morpheus
.
Util
.
getFileName
(
value
);
morpheus
.
OpenDatasetTool
.
fileExtensionPrompt
(
fileName
,
function
(
morpheus
.
OpenDatasetTool
.
fileExtensionPrompt
(
fileName
,
function
(
readOptions
)
{
readOptions
)
{
if
(
readOptions
)
{
if
(
readOptions
)
{
var
dataset
=
options
.
dataset
;
var
dataset
=
options
.
dataset
;
options
.
dataset
=
{
options
.
dataset
=
{
file
:
dataset
,
file
:
dataset
,
options
:
{}
options
:
{}
};
};
for
(
var
key
in
readOptions
)
{
for
(
var
key
in
readOptions
)
{
options
.
dataset
.
options
[
key
]
=
readOptions
[
key
];
options
.
dataset
.
options
[
key
]
=
readOptions
[
key
];
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment