Skip to content
Snippets Groups Projects
Commit d37f3af3 authored by juanf's avatar juanf
Browse files

Research to use a drawing board on the ELN

SVN: 34549
parent 2a5e7a57
No related branches found
No related tags found
No related merge requests found
...@@ -171,6 +171,10 @@ ...@@ -171,6 +171,10 @@
<script type="text/javascript" src="./js/views/legacy/SampleLinksWidget.js"></script> <script type="text/javascript" src="./js/views/legacy/SampleLinksWidget.js"></script>
<script type="text/javascript" src="./js/views/legacy/SampleHierarchy.js"></script> <script type="text/javascript" src="./js/views/legacy/SampleHierarchy.js"></script>
<script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsController.js"></script>
<script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsModel.js"></script>
<script type="text/javascript" src="./js/views/DrawingBoards/DrawingBoardsView.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// //
// Configurations Available (Available under the js/config folder) // Configurations Available (Available under the js/config folder)
......
...@@ -411,30 +411,9 @@ function MainController(profile) { ...@@ -411,30 +411,9 @@ function MainController(profile) {
} }
this._showDrawingBoard = function() { this._showDrawingBoard = function() {
var mainContainer = $("#mainContainer"); var drawingBoardsController = new DrawingBoardsController(this);
mainContainer.empty(); drawingBoardsController.init($("#mainContainer"));
this.currentView = drawingBoardsController;
var containerWidth = $(document).width() - $("#sideMenu").width() - 20;
var containerHeight = $(document).height() - 60;
var $drawingboard = $("<div>", { "id" : "scratchboard", "style" : "width: " + containerWidth + "px; height: " + containerHeight + "px; padding: 10px;" });
mainContainer.append($drawingboard);
//pass options and add custom controls to a board
var customBoard = new DrawingBoard.Board('scratchboard', {
background: "#ffffff",
color: "#000",
webStorage: false,
size: 30,
controls: [
{ Size: { type: "dropdown" } },
{ Navigation: { back: false, forward: false } },
'DrawingMode',
'Color',
'Download'
],
webStorage: 'local'
});
} }
this._showUserManager = function() { this._showUserManager = function() {
......
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function DrawingBoardsController(mainController) {
this._mainController = mainController;
this._drawingBoardsModel = new DrawingBoardsModel();
this._drawingBoardsView = new DrawingBoardsView(this, this._drawingBoardsModel);
this.init = function($container) {
this._drawingBoardsView.repaint($container);
}
}
\ No newline at end of file
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function DrawingBoardsModel() {
}
\ No newline at end of file
/*
* Copyright 2014 ETH Zuerich, Scientific IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function DrawingBoardsView(drawingBoardsController, drawingBoardsModel) {
this._drawingBoardsController = drawingBoardsController;
this._drawingBoardsModel = drawingBoardsModel;
this.repaint = function($container) {
$container.empty();
var $wrapper = $('<form>', { class : 'form-horizontal ', 'id' : 'mainDataSetForm', 'role' : 'form'});
var $title = $('<h2>').append('Drawing Board');
$wrapper.append($title);
var $createNewBtn = FormUtil.getButtonWithText('New Drawing Board', function() {
$container.empty();
var containerWidth = $(document).width() - $("#sideMenu").width() - 20;
var containerHeight = $(document).height() - 60;
var $drawingboard = $("<div>", { "id" : "scratchboard", "style" : "width: " + containerWidth + "px; height: " + containerHeight + "px; padding: 10px;" });
$container.append($drawingboard);
//pass options and add custom controls to a board
var customBoard = new DrawingBoard.Board('scratchboard', {
background: "#ffffff",
color: "#000",
webStorage: false,
size: 30,
controls: [
{ Size: { type: "dropdown" } },
{ Navigation: { back: false, forward: false } },
'DrawingMode',
'Color',
'Download'
]
});
});
$wrapper.append($createNewBtn);
$container.append($wrapper);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment