Skip to content

Commit

Permalink
Fix for #62
Browse files Browse the repository at this point in the history
  • Loading branch information
istemi-bahceci committed Dec 19, 2016
1 parent 79aaf1d commit 375e771
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 76 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ app.use('/node_modules/bootstrap-select', express.static(__dirname + '/node_modu

var multerInstance = multer({dest:'./uploads/'});

//var APP_PORT = 3000;
var APP_PORT = 80;
var APP_PORT = 3000;
//var APP_PORT = 80;

//get handler for index.html
function indexGetHandler(req,res){
Expand Down
4 changes: 2 additions & 2 deletions public/bin/base.min.css

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions public/bin/base.min.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<link rel="stylesheet" href="node_modules/cytoscape-navigator/cytoscape.js-navigator.css" charset="utf-8">
<link rel="stylesheet" href="node_modules/bootstrap-select/dist/css/bootstrap-select.min.css" charset="utf-8">
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.css">
<link rel="stylesheet" href="lib/js/bootstrap-color-picker/css/bootstrap-colorpicker.min.css" charset="utf-8">

<!--For debugging-->
<link rel="stylesheet" href="bin/base.css" charset="utf-8">
Expand Down Expand Up @@ -692,8 +691,7 @@ <h3 class="modal-title">Grid Options</h3>
<div id="colorPickerDiv" class="input-group colorpicker-component">
<label class="control-label col-sm-4" for="gridSize">Guideline Color:</label>
<div class="col-sm-8">
<input id="colorPickerInput" value="#000000" type="text" class="form-control" />
<span id="colorPickerButton" class="input-group-addon"><i></i></span>
<input value="#000000" type="color" class="form-control" />
</div>
</div>
</form>
Expand Down Expand Up @@ -741,7 +739,6 @@ <h3 class="modal-title">Grid Options</h3>
<script src="lib/js/cytoscape-edgeHandles.js" charset="utf-8"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.js"></script>
<script src="https://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
<script src="lib/js/bootstrap-color-picker/js/bootstrap-colorpicker.min.js" charset="utf-8"></script>

</body>
</html>

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

23 changes: 15 additions & 8 deletions public/src/css/sass/_notificationStyles.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[data-notify="container"][class*="alert-pastel-"]
[data-notify="container"][class*="alert-pathwayMapper-"]
{
background-color: $menuHoverColor;
color: #FFFFFF;

.close{
opacity: 1.0;
color: #FFFFFF;
Expand All @@ -14,13 +11,23 @@
color: #FFFFFF;
}
}
//[data-notify="container"].alert-pastel-info {
// border-left-color: rgb(255, 179, 40);
//}

[data-notify="container"].alert-pathwayMapper-success
{
background-color: $menuHoverColor;
color: #FFFFFF;
}

[data-notify="container"].alert-pathwayMapper-fail
{
background-color: #ff2644;
color: #FFFFFF;
}

//[data-notify="container"].alert-pastel-danger {
// border-left-color: rgb(255, 103, 76);
//}

[data-notify="container"][class*="alert-pastel-"] > [data-notify="message"] {
[data-notify="container"][class*="alert-pathwayMapper-"] > [data-notify="message"] {
//font-weight: 400;
}
10 changes: 6 additions & 4 deletions public/src/css/sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ body {

$appContentHeight: 850px;

#colorPickerInput
input[type="color"]
{
width: 287px;
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0 !important;

padding: 2px 2px 2px 2px;
}

input[type="color"]:hover{
cursor: pointer;
}

#colorPickerButton
Expand Down
5 changes: 3 additions & 2 deletions public/src/js/AppManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var regCose = require("../../lib/js/cose-bilkent/src/index.js");
var grid_guide = require('cytoscape-grid-guide');
var undoRedo = require('cytoscape-undo-redo');
var contextMenus = require('cytoscape-context-menus');
require('bootstrap-select');


//Panzoom options
Expand All @@ -27,7 +28,6 @@ require('./OtherMenuOperations.js');
require('./GenomicMenuOperations.js');
require('./ViewOperationsManager.js');
require('./GraphUtilities.js');
require('bootstrap-select');

var QtipManager = require('./QtipManager.js');
var ContextMenuManager = require('./ContextMenuManager.js');
Expand All @@ -37,6 +37,7 @@ var SaveLoadUtilities = require('./SaveLoadUtility.js');
var CBioPortalAccessor = require('./cBioPortalAccessor.js');

var notify = require('bootstrap-notify');
window.notificationManager = require('./NotificationFactory');

module.exports = (function()
{
Expand Down Expand Up @@ -362,7 +363,7 @@ var notify = require('bootstrap-notify');
cy.style().update();
cy.forceRender();
});

};

return AppManager;
Expand Down
6 changes: 2 additions & 4 deletions public/src/js/BackboneViews/GridOptionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ var gridOptionsView = Backbone.View.extend(
var tplContent = this.template(templateProperties);
this.$el.empty();
this.$el.append(tplContent);
this.$el.find('#colorPickerDiv').colorpicker();

this.delegateEvents();
},
saveProperties: function(event)
Expand All @@ -49,7 +47,7 @@ var gridOptionsView = Backbone.View.extend(
this.currentProperties.drawGrid = this.$el.find("#showGrid").is(':checked');
this.currentProperties.guidelines = this.$el.find("#showGuides").is(':checked');
this.currentProperties.snapToGrid = this.$el.find("#snapToGrid").is(':checked');
this.currentProperties.guidelinesStyle.strokeStyle = this.$el.find("#colorPickerInput").val();
this.currentProperties.guidelinesStyle.strokeStyle = this.$el.find('input[type="color"]').val();


//TODO update grid options
Expand All @@ -62,7 +60,7 @@ var gridOptionsView = Backbone.View.extend(
this.$el.find("#gridSize").val(this.currentProperties.gridSize);
this.$el.find("#showGrid")[0].checked = this.currentProperties.showGrid;
this.$el.find("#showGuides")[0].checked = this.currentProperties.showGuides;
this.$el.find("#colorPickerInput").val(this.currentProperties.guidelinesStyle.strokeStyle);
this.$el.find('input[type="color"]').val(this.currentProperties.guidelinesStyle.strokeStyle);
},
defaultLayoutHandler: function(event)
{
Expand Down
52 changes: 52 additions & 0 deletions public/src/js/NotificationFactory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = (function ($)
{

function NotificationFactory()
{
}

function mapTypeToCSSStyle(type)
{
if (type === "success")
return "pathwayMapper-success"
else if (type === "fail")
return "pathwayMapper-fail"

}

NotificationFactory.prototype.createNotification = function(message, type)
{

var mappedCSSClass = mapTypeToCSSStyle(type);

$.notify({
// options
icon: 'glyphicon glyphicon-ok',
message: message
},{
// settings
element: 'body',
position: null,
type: mappedCSSClass,
allow_dismiss: true,
newest_on_top: false,
showProgressbar: false,
placement: {
from: "bottom",
align: "right"
},
delay: 0,
offset: 20,
spacing: 10,
z_index: 1031,
mouse_over: null,
animate: {
enter: 'animated fadeInUp',
exit: 'animated fadeOut'
}
});
}

return new NotificationFactory();

})(window.$);
27 changes: 0 additions & 27 deletions public/src/js/OtherMenuOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,6 @@ module.exports = (function()
//Edit drop down handler
$(".editDropDown li a").click(function(event)
{
$.notify({
// options
icon: 'glyphicon glyphicon-ok',
message: 'Data is loaded ...',
},{
// settings
element: 'body',
position: null,
type: "pastel-warning",
allow_dismiss: true,
newest_on_top: false,
showProgressbar: false,
placement: {
from: "bottom",
align: "right"
},
delay: 0,
offset: 20,
spacing: 10,
z_index: 1031,
mouse_over: null,
animate: {
enter: 'animated fadeInUp',
exit: 'animated fadeOut'
}
});

event.preventDefault();
var dropdownLinkRole = $(event.target).attr('role');

Expand Down
12 changes: 12 additions & 0 deletions public/src/js/cBioPortalAccessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ module.exports = (function()
}
callbackFunction(cancerStudies);
}
else if (request.readyState === XMLHttpRequest.DONE && request.status != 200)
{
window.notificationManager.createNotification("Error retrieving cancer studies", "fail")
}
};
request.open("GET", this.GET_ALL_CANCER_STUDIES_URL);
request.send();
Expand Down Expand Up @@ -86,6 +90,10 @@ module.exports = (function()

callbackFunction(outData);
}
else if (request.readyState === XMLHttpRequest.DONE && request.status != 200)
{
window.notificationManager.createNotification("Error retrieving genetic profiles", "fail")
}
};
request.open("GET", this.GET_GENETIC_PROFILES_URL + cancerStudy);
request.send();
Expand Down Expand Up @@ -195,6 +203,10 @@ module.exports = (function()
if(request.readyState === XMLHttpRequest.DONE && request.status === 200)
{
self.calcAlterationPercentages(request.responseText, params.geneticProfileId, callbackFunction);
window.notificationManager.createNotification(
"Profile data " + params.geneticProfileId + " is succesfully loaded from cBioPortal ",
"success");

}
};

Expand Down

0 comments on commit 375e771

Please sign in to comment.