Repository: openmeetings
Updated Branches:
  refs/heads/master 0e0c280d6 -> b1a440211


[OPENMEETINGS-1642] page control and zoom seems to be implemented


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/b1a44021
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/b1a44021
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/b1a44021

Branch: refs/heads/master
Commit: b1a44021176200ff8726674dd3fb94a356695770
Parents: 0e0c280
Author: Maxim Solodovnik <solomax...@gmail.com>
Authored: Mon Aug 7 16:50:43 2017 +0700
Committer: Maxim Solodovnik <solomax...@gmail.com>
Committed: Mon Aug 7 16:50:43 2017 +0700

----------------------------------------------------------------------
 .../openmeetings/web/room/wb/WbPanel.java       | 11 +++++++++++
 .../org/apache/openmeetings/web/room/wb/wb.js   | 20 ++++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/b1a44021/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
----------------------------------------------------------------------
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
index 344bf91..2c32d81 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
@@ -47,6 +47,7 @@ import 
org.apache.openmeetings.core.data.whiteboard.WhiteboardCache;
 import org.apache.openmeetings.db.dao.file.FileExplorerItemDao;
 import org.apache.openmeetings.db.dao.record.RecordingDao;
 import org.apache.openmeetings.db.dto.room.Whiteboard;
+import org.apache.openmeetings.db.dto.room.Whiteboard.ZoomMode;
 import org.apache.openmeetings.db.dto.room.Whiteboards;
 import org.apache.openmeetings.db.entity.basic.Client;
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
@@ -164,6 +165,16 @@ public class WbPanel extends Panel {
                                                        clearAll(roomId, 
obj.getLong("wbId"));
                                                }
                                                        break;
+                                               case setSize:
+                                               {
+                                                       Whiteboard wb = 
WhiteboardCache.get(roomId).get(obj.getLong("wbId"));
+                                                       
wb.setZoom(obj.getDouble("zoom"));
+                                                       
wb.setZoomMode(ZoomMode.valueOf(obj.getString("zoomMode")));
+                                                       
WhiteboardCache.update(roomId, wb);
+                                                       
sendWbOthers(WbAction.setSize, getAddWbJson(wb));
+                                                       //TODO scroll????
+                                               }
+                                                       break;
                                                default:
                                                        break;
                                        }

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/b1a44021/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
----------------------------------------------------------------------
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
index 89d00ad..6fafd0e 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
@@ -751,11 +751,21 @@ var Wb = function() {
                                        wb.zoom -= .2;
                                        wb.zoomMode = 'zoom';
                                        _setSize();
+                                       wbAction('setSize', JSON.stringify({
+                                               wbId: wb.id
+                                               , zoom: wb.zoom
+                                               , zoomMode: wb.zoomMode
+                                       }));
                                });
                                z.find('.zoom-in').click(function() {
                                        wb.zoom += .2;
                                        wb.zoomMode = 'zoom';
                                        _setSize();
+                                       wbAction('setSize', JSON.stringify({
+                                               wbId: wb.id
+                                               , zoom: wb.zoom
+                                               , zoomMode: wb.zoomMode
+                                       }));
                                });
                                z.find('.zoom').change(function() {
                                        var zzz = $(this).val();
@@ -774,6 +784,11 @@ var Wb = function() {
                                                wb.zoom = 1. * zzz;
                                        }
                                        _setSize();
+                                       wbAction('setSize', JSON.stringify({
+                                               wbId: wb.id
+                                               , zoom: wb.zoom
+                                               , zoomMode: wb.zoomMode
+                                       }));
                                });
                                _setSize();
                                initToolBtn('apointer', _firstToolItem, 
APointer(wb));
@@ -1030,9 +1045,11 @@ var Wb = function() {
                switch (wb.zoomMode) {
                        case 'fullFit':
                                wb.zoom = Math.min((a.width() - 10) / wb.width, 
(a.height() - 10) / wb.height);
+                               z.find('.zoom').val(wb.zoomMode);
                                break;
                        case 'pageWidth':
                                wb.zoom = (a.width() - 10) / wb.width;
+                               z.find('.zoom').val(wb.zoomMode);
                                break;
                        default:
                        {
@@ -1114,6 +1131,9 @@ var Wb = function() {
                                , collision: "fit"
                        });
                }
+               if (wb.zoomMode !== 'zoom') {
+                       _setSize();
+               }
        };
        wb.load = function(arr) {
                _createObject(arr, _createHandler);

Reply via email to