Commit 2622f6b8 by Kim Peace

Changed class to function for not to use es6

parent c64b670e
......@@ -6,84 +6,73 @@ NativeBridgeDataSource.getCollaborationJoinFlg = function () {
}
};
var CoviewUserInfo = class {
sid;
loginId;
roomId;
shopName;
collaborationType;
joinType;
isLeaved;
meetingID;
function CoviewUserInfo(sid, loginId, roomId, shopName) {
this.sid = sid;
this.loginId = loginId;
this.roomId = roomId;
this.shopName = shopName;
const unwrappedType = NativeBridgeDataSource.getJoinCollaborationType();
this.collaborationType = this.parseNumberToCoworkType(unwrappedType);
this.joinType = NativeBridgeDataSource.getCollaborationJoinFlg();
constructor(sid, loginId, roomId, shopName) {
this.sid = sid;
this.loginId = loginId;
this.roomId = roomId;
this.shopName = shopName;
const unwrappedType = NativeBridgeDataSource.getJoinCollaborationType();
this.collaborationType = this.parseNumberToCoworkType(unwrappedType);
this.joinType = NativeBridgeDataSource.getCollaborationJoinFlg();
this.isLeaved = false;
this.meetingID = 0;
}
this.isLeaved = false;
this.meetingID = 0;
}
get coWorkType() {
switch (this.collaborationType) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE.AUDIO;
}
CoviewUserInfo.prototype.coWorkType = function () {
switch (this.collaborationType) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE.AUDIO;
}
};
isInvited() {
return this.joinType == COLLABORATION_JOIN_TYPE.INVITED;
}
CoviewUserInfo.prototype.isInvited = function () {
return this.joinType == COLLABORATION_JOIN_TYPE.INVITED;
};
parseNumberToCoworkType(type) {
switch (type) {
case COLLABORATION_TYPE_NUMBER.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE_NUMBER.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE_NUMBER.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE_NUMBER.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT;
case COLLABORATION_TYPE_NUMBER.BOARD:
return COLLABORATION_TYPE.BOARD;
default:
return 0;
}
CoviewUserInfo.prototype.parseNumberToCoworkType = function (type) {
switch (type) {
case COLLABORATION_TYPE_NUMBER.AUDIO:
return COLLABORATION_TYPE.AUDIO;
case COLLABORATION_TYPE_NUMBER.CAMERA:
return COLLABORATION_TYPE.CAMERA;
case COLLABORATION_TYPE_NUMBER.VIDEO:
return COLLABORATION_TYPE.VIDEO;
case COLLABORATION_TYPE_NUMBER.DOCUMENT:
return COLLABORATION_TYPE.DOCUMENT;
case COLLABORATION_TYPE_NUMBER.BOARD:
return COLLABORATION_TYPE.BOARD;
default:
return 0;
}
};
getCollaborarionTypeAsNumber() {
return this.parseCoworkTypeToNumber(this.collaborationType);
}
CoviewUserInfo.prototype.getCollaborarionTypeAsNumber = function () {
return this.parseCoworkTypeToNumber(this.collaborationType);
};
parseCoworkTypeToNumber(type) {
switch (type) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE_NUMBER.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE_NUMBER.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE_NUMBER.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE_NUMBER.DOCUMENT;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE_NUMBER.BOARD;
default:
return 0;
}
CoviewUserInfo.prototype.parseCoworkTypeToNumber = function (type) {
switch (type) {
case COLLABORATION_TYPE.AUDIO:
return COLLABORATION_TYPE_NUMBER.AUDIO;
case COLLABORATION_TYPE.CAMERA:
return COLLABORATION_TYPE_NUMBER.CAMERA;
case COLLABORATION_TYPE.VIDEO:
return COLLABORATION_TYPE_NUMBER.VIDEO;
case COLLABORATION_TYPE.DOCUMENT:
return COLLABORATION_TYPE_NUMBER.DOCUMENT;
case COLLABORATION_TYPE.BOARD:
return COLLABORATION_TYPE_NUMBER.BOARD;
default:
return 0;
}
};
......
......@@ -6,30 +6,24 @@ NativeBridgeDataSource.getDeviceInfo = function () {
}
};
var DeviceInfo = class {
isMoble; // iphone or iPad
platform; // ios or android
androidVersion;
constructor(deviceInfo) {
this.isMoble = deviceInfo.isMoble;
this.platform = deviceInfo.platform;
if (typeof android != "undefined") {
this.androidVersion = android.getAndroidVersion();
}
function DeviceInfo(deviceInfo) {
this.isMoble = deviceInfo.isMoble;
this.platform = deviceInfo.platform;
if (typeof android != "undefined") {
this.androidVersion = android.getAndroidVersion();
}
}
isiOS() {
return this.platform == "ios";
}
DeviceInfo.prototype.isiOS = function () {
return this.platform == "ios";
};
isAndroid() {
return this.platform == "android";
}
DeviceInfo.prototype.isAndroid = function () {
return this.platform == "android";
};
isMobile() {
return this.isMoble == true;
}
DeviceInfo.prototype.isMobile = function () {
return this.isMoble == true;
};
var deviceInfo = new DeviceInfo(NativeBridgeDataSource.getDeviceInfo());
......
......@@ -6,15 +6,10 @@ NativeBridgeDataSource.getRoomInfo = function () {
}
};
var RoomInfo = class {
roomID;
roomName;
roomType;
constructor(roomInfo) {
this.roomID = roomInfo.roomID;
this.roomName = roomInfo.roomName;
this.roomType = roomInfo.roomType;
}
};
function RoomInfo(roomInfo) {
this.roomID = roomInfo.roomID;
this.roomName = roomInfo.roomName;
this.roomType = roomInfo.roomType;
}
var roomInfo = new RoomInfo(NativeBridgeDataSource.getRoomInfo());
......@@ -6,16 +6,10 @@ NativeBridgeDataSource.getServerInfo = function () {
}
};
var ServerInfo = class {
chatURL;
cmsURL;
isOnline;
constructor(serverInfo) {
this.chatURL = serverInfo.chatURL;
this.cmsURL = serverInfo.cmsURL;
this.isOnline = serverInfo.isOnline;
}
};
function ServerInfo(serverInfo) {
this.chatURL = serverInfo.chatURL;
this.cmsURL = serverInfo.cmsURL;
this.isOnline = serverInfo.isOnline;
}
var serverInfo = new ServerInfo(NativeBridgeDataSource.getServerInfo());
var JoinInfo = class {
sid;
loginId;
shopName;
roomId;
roomName;
shopMemberId;
constructor(sid, loginId, shopName, roomId, roomName, shopMemberId) {
this.sid = sid;
this.loginId = loginId;
this.shopName = shopName;
this.roomId = roomId;
this.roomName = roomName;
this.shopMemberId = shopMemberId;
}
};
function JoinInfo(sid, loginId, shopName, roomId, roomName, shopMemberId) {
this.sid = sid;
this.loginId = loginId;
this.shopName = shopName;
this.roomId = roomId;
this.roomName = roomName;
this.shopMemberId = shopMemberId;
}
......@@ -6,30 +6,25 @@ NativeBridgeDataSource.getMyUserInfo = function () {
}
};
var CurrentUserInfo = class {
sid;
loginID;
shopName;
shopMemberID;
languageCode;
constructor(userInfo) {
this.sid = userInfo.sid;
this.loginID = userInfo.loginId;
this.shopName = userInfo.shopName;
this.shopMemberID = userInfo.shopMemberId;
if (userInfo.languageCode == undefined) {
userInfo.languageCode = "jp";
}
this.languageCode = userInfo.languageCode;
function CurrentUserInfo(userInfo) {
this.sid = userInfo.sid;
this.loginID = userInfo.loginId;
this.shopName = userInfo.shopName;
this.shopMemberID = userInfo.shopMemberId;
if (userInfo.languageCode == undefined) {
userInfo.languageCode = "jp";
}
this.languageCode = userInfo.languageCode;
}
configureLanguage(languageCode = undefined) {
if (languageCode == undefined) {
languageCode = this.languageCode;
}
moment.locale(languageCode);
setLanguage(languageCode);
CurrentUserInfo.prototype.configureLanguage = function (
languageCode = undefined
) {
if (languageCode == undefined) {
languageCode = this.languageCode;
}
moment.locale(languageCode);
setLanguage(languageCode);
};
var currentUserInfo = new CurrentUserInfo(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment