From 97ee5a24f3705eaa67114ee2728259b61d3220cc Mon Sep 17 00:00:00 2001 From: Vahid Hedayati Date: Sat, 4 Jul 2015 22:53:46 +0100 Subject: [PATCH] missing files for 3.0.2 --- LICENSE | 202 ++++++++ grails-app/assets/javascripts/usermenu.js | 474 +++++++++++++++++ grails-app/assets/javascripts/wschat.js | 475 ------------------ grails-app/assets/stylesheets/chat-blue.css | 2 +- grails-app/assets/stylesheets/chat-red.css | 2 +- grails-app/assets/stylesheets/chat-ui.css | 276 ++++++++++ grails-app/assets/stylesheets/chat.css | 277 +--------- .../plugin/wschat/WsChatController.groovy | 6 +- .../client/WsChatClientController.groovy | 18 +- .../wschat/client/WsChatClientService.groovy | 6 +- .../grails/plugin/wschat/WsChatTagLib.groovy | 17 +- grails-app/views/wsChat/_process.gsp | 4 +- grails-app/views/wsChat/index.gsp | 2 +- .../plugin/wschat/beans/ConnectTagBean.groovy | 6 - .../wschat/client/WsChatClientEndpoint.groovy | 2 + .../groovy/wschat/DefaultWsChatConfig.groovy | 8 +- 16 files changed, 991 insertions(+), 786 deletions(-) create mode 100644 LICENSE create mode 100644 grails-app/assets/javascripts/usermenu.js diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e06d208 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + diff --git a/grails-app/assets/javascripts/usermenu.js b/grails-app/assets/javascripts/usermenu.js new file mode 100644 index 0000000..c8192c3 --- /dev/null +++ b/grails-app/assets/javascripts/usermenu.js @@ -0,0 +1,474 @@ +function processMessage(message) { + + + var jsonData=JSON.parse(message.data); + + if (debug == "on") { + console.log('@onMessage: '+JSON.stringify(message.data)); + } + + + if (jsonData.message!=null) { + $('#chatMessages').append(htmlEncode(jsonData.message)+"\n"); + } + if (jsonData.isAdmin!=null) { + isAdmin=jsonData.isAdmin + } + + if (jsonData.isBanned!=null) { + $('#chatMessages').append(htmlEncode(jsonData.isBanned)+"\n"); + webSocket.send("DISCO:-"+user); + $('#chatMessages').append(user+" disconnecting from server... \n"); + $('#onlineUsers').html(""); + messageBox.value=""; + webSocket.close(); + } + + if (jsonData.system!=null) { + if (jsonData.system=="disconnect") { + webSocket.send("DISCO:-"+user); + $('#chatMessages').append(user+" disconnecting from server... \n"); + $('#onlineUsers').html(""); + messageBox.value=""; + webSocket.close(); + } + if (jsonData.system=="closecam") { + popup_window.close (); + webSocket.send("/camdisabled "+user); + } + } + + + if (jsonData.users!=null) { + $('#onlineUsers').html(""); + var sb = []; + var sb1 = []; + var sb2 = []; + var sb3 = []; + var sb4 = []; + var sb5 = []; + // for games use glyphicon-tower + + jsonData.users.forEach(function(entry) { + + if (entry.owner_rtc!=null) { + sb.push('\n\n\n\n'); + } + + if (entry.owner_file!=null) { + sb.push('\n\n\n\n'); + } + + if (entry.owner_mediastream!=null) { + sb.push('\n\n\n\n'); + } + + if (entry.owner_av!=null) { + sb.push('\n\n\n\n'); + } + + if (entry.owner!=null) { + sb.push('\n\n\n\n'); + } + + /*------------------------------------------------------------------------------------------*/ + + if (entry.friends_rtc!=null) { + sb1.push('\n\n\n\n'); + } + + if (entry.friends_av!=null) { + sb1.push('\n\n\n\n'); + } + + + if (entry.friends_file!=null) { + sb1.push('\n\n\n\n'); + } + + if (entry.friends_mediastream!=null) { + sb1.push('\n\n\n\n'); + } + + if (entry.friends!=null) { + sb1.push('\n\n\n\n'); + } + + /*------------------------------------------------------------------------------------------*/ + + if (entry.user_rtc!=null) { + sb2.push('\n\n\n\n'); + } + + if (entry.user_av!=null) { + sb2.push('\n\n\n\n'); + } + + if (entry.user_mediastream!=null) { + sb2.push('\n\n\n\n'); + } + + if (entry.user_file!=null) { + sb2.push('\n\n\n\n'); + } + + if (entry.user!=null) { + sb2.push('\n\n\n\n'); + } + + /*------------------------------------------------------------------------------------------*/ + + if (entry.blocked!=null) { + sb3.push('\n\n\n\n'); + } + + + /*------------------------------------------------------------------------------------------*/ + + if (entry.offline_friends!=null) { + sb4.push('\n\n\n\n'); + } + /*------------------------------------------------------------------------------------------*/ + if (entry.online_friends!=null) { + sb5.push('\n\n\n\n'); + } + + }); + $('#onlineUsers').html(sb.join("")+sb1.join("")+sb2.join("")+sb3.join("")); + + $('#friendsList').html(sb5.join("")+sb4.join("")) + } + if (jsonData.currentRoom!=null) { + currentRoom=jsonData.currentRoom + } + if (jsonData.rooms!=null) { + var rms = []; + rms.push('\n'); + var admintool=adminRooms(isAdmin) + rms.push(admintool); + + + + $('#chatRooms').html(rms.join("")); + } + + if (jsonData.privateMessage!=null) { + var receiver + var sender + if (jsonData.msgFrom!=null) { + sender=jsonData.msgFrom + } + if (jsonData.msgTo!=null) { + receiver=jsonData.msgTo + } + $('#chatMessages').append("PM("+sender+"): "+jsonData.privateMessage+"\n"); + sendPM(receiver,sender,jsonData.privateMessage); + } +} diff --git a/grails-app/assets/javascripts/wschat.js b/grails-app/assets/javascripts/wschat.js index 9cdeab3..8eef446 100644 --- a/grails-app/assets/javascripts/wschat.js +++ b/grails-app/assets/javascripts/wschat.js @@ -137,481 +137,6 @@ function processChatMessage(message) { WebCam.close(); } } -} - -function processMessage(message) { - - - var jsonData=JSON.parse(message.data); - - if (debug == "on") { - console.log('@onMessage: '+JSON.stringify(message.data)); - } - - - if (jsonData.message!=null) { - $('#chatMessages').append(htmlEncode(jsonData.message)+"\n"); - } - if (jsonData.isAdmin!=null) { - isAdmin=jsonData.isAdmin - } - - if (jsonData.isBanned!=null) { - $('#chatMessages').append(htmlEncode(jsonData.isBanned)+"\n"); - webSocket.send("DISCO:-"+user); - $('#chatMessages').append(user+" disconnecting from server... \n"); - $('#onlineUsers').html(""); - messageBox.value=""; - webSocket.close(); - } - - if (jsonData.system!=null) { - if (jsonData.system=="disconnect") { - webSocket.send("DISCO:-"+user); - $('#chatMessages').append(user+" disconnecting from server... \n"); - $('#onlineUsers').html(""); - messageBox.value=""; - webSocket.close(); - } - if (jsonData.system=="closecam") { - popup_window.close (); - webSocket.send("/camdisabled "+user); - } - } - - - if (jsonData.users!=null) { - $('#onlineUsers').html(""); - var sb = []; - var sb1 = []; - var sb2 = []; - var sb3 = []; - var sb4 = []; - var sb5 = []; - // for games use glyphicon-tower - - jsonData.users.forEach(function(entry) { - - if (entry.owner_rtc!=null) { - sb.push('\n\n\n\n'); - } - - if (entry.owner_file!=null) { - sb.push('\n\n\n\n'); - } - - if (entry.owner_mediastream!=null) { - sb.push('\n\n\n\n'); - } - - if (entry.owner_av!=null) { - sb.push('\n\n\n\n'); - } - - if (entry.owner!=null) { - sb.push('\n\n\n\n'); - } - - /*------------------------------------------------------------------------------------------*/ - - if (entry.friends_rtc!=null) { - sb1.push('\n\n\n\n'); - } - - if (entry.friends_av!=null) { - sb1.push('\n\n\n\n'); - } - - - if (entry.friends_file!=null) { - sb1.push('\n\n\n\n'); - } - - if (entry.friends_mediastream!=null) { - sb1.push('\n\n\n\n'); - } - - if (entry.friends!=null) { - sb1.push('\n\n\n\n'); - } - - /*------------------------------------------------------------------------------------------*/ - - if (entry.user_rtc!=null) { - sb2.push('\n\n\n\n'); - } - - if (entry.user_av!=null) { - sb2.push('\n\n\n\n'); - } - - if (entry.user_mediastream!=null) { - sb2.push('\n\n\n\n'); - } - - if (entry.user_file!=null) { - sb2.push('\n\n\n\n'); - } - - if (entry.user!=null) { - sb2.push('\n\n\n\n'); - } - - /*------------------------------------------------------------------------------------------*/ - - if (entry.blocked!=null) { - sb3.push('\n\n\n\n'); - } - - - /*------------------------------------------------------------------------------------------*/ - - if (entry.offline_friends!=null) { - sb4.push('\n\n\n\n'); - } - /*------------------------------------------------------------------------------------------*/ - if (entry.online_friends!=null) { - sb5.push('\n\n\n\n'); - } - - }); - $('#onlineUsers').html(sb.join("")+sb1.join("")+sb2.join("")+sb3.join("")); - - $('#friendsList').html(sb5.join("")+sb4.join("")) - } - if (jsonData.currentRoom!=null) { - currentRoom=jsonData.currentRoom - } - if (jsonData.rooms!=null) { - var rms = []; - rms.push('\n'); - var admintool=adminRooms(isAdmin) - rms.push(admintool); - - - - $('#chatRooms').html(rms.join("")); - } - - if (jsonData.privateMessage!=null) { - var receiver - var sender - if (jsonData.msgFrom!=null) { - sender=jsonData.msgFrom - } - if (jsonData.msgTo!=null) { - receiver=jsonData.msgTo - } - $('#chatMessages').append("PM("+sender+"): "+jsonData.privateMessage+"\n"); - sendPM(receiver,sender,jsonData.privateMessage); - } } function joinRoom(user,room) { diff --git a/grails-app/assets/stylesheets/chat-blue.css b/grails-app/assets/stylesheets/chat-blue.css index e589ed8..57ae2fe 100644 --- a/grails-app/assets/stylesheets/chat-blue.css +++ b/grails-app/assets/stylesheets/chat-blue.css @@ -55,4 +55,4 @@ textarea{ width: 91%; background: #104E8B; color:#FFF; -} \ No newline at end of file +} diff --git a/grails-app/assets/stylesheets/chat-red.css b/grails-app/assets/stylesheets/chat-red.css index 659d1d8..11626da 100644 --- a/grails-app/assets/stylesheets/chat-red.css +++ b/grails-app/assets/stylesheets/chat-red.css @@ -58,4 +58,4 @@ textarea{ width: 91%; background: #8B2500; color:#FFF; -} \ No newline at end of file +} diff --git a/grails-app/assets/stylesheets/chat-ui.css b/grails-app/assets/stylesheets/chat-ui.css index ebdd71b..7156421 100644 --- a/grails-app/assets/stylesheets/chat-ui.css +++ b/grails-app/assets/stylesheets/chat-ui.css @@ -354,6 +354,282 @@ color: $main-color; #search_chat_contact_flexselect_dropdown li:hover { background: $separation-color; } +#cmessage{ + float: right; + width: 100%; + min-height: 25em; + height: 25em; + text-align: left; + font-family: monospace; + position: relative; + display: block; + overflow: auto; + margin-top: 2px; + white-space: pre-line; + border-style: solid; + border-width: thin; + border-color: #AAA; + font-size: 1em; + word-wrap: break-word; + resize:both; +} +#chatterBox { + left: auto; + right: auto; +} +#colourthemes{ + position: absolute; + right: 2em; + top: 4em; + float:right; +} +/* webrtc style sheet */ +.section { + width: 100%; + margin: auto; + padding: 2em 1em; + color: #525252; +} +.section.login, +.section.room { + display: block; +} + +/* Video-Stuff */ +.video-wrapper { + width: 100%; + max-width: 50em; + margin: auto; + position: relative; +} +.own-video, +.other-video { + background-color: #F5F5F5; + border: 4px solid #2C5651; + border-radius: 6px; +} +.own-video { + width: 100%; + max-width: 6em; + max-height: 5em; + position: absolute; + right: 1em; + bottom: 1em; +} +.other-video { + height: 100%; + max-height: 30em; + max-width: 100%; +} + +#userInputError { + display:inline-block; + *display:inline; + *zoom:1; +} +#userInput{ + display:inline-block; + *display:inline; + *zoom:1; + width: 180px; +} +#response_image{ + display:inline-block; + *display:inline; + *zoom:1; + width: 24px; + +} +.online { + width: 16px; + height: 16px; + background: url(../images/accept.png) no-repeat 100% 100%; +} + +.offline { + width: 16px; + height: 16px; + background: url(../images/reject.png) no-repeat 100% 100%; +} + +#accept { + width: 16px; + height: 16px; + background: url(../images/accept.png) no-repeat 100% 100%; + display:inline-block; + *display:inline; + *zoom:1; + float:right; +} + +#reject { + width: 16px; + height: 16px; + background: url(../images/reject.png) no-repeat 100% 100%; + display:inline-block; + *display:inline; + *zoom:1; + float:right; +} +#question { + width: 16px; + height: 16px; + background: url(../images/exclamation.png) no-repeat 100% 100%; + display:inline-block; + *display:inline; + *zoom:1; + float:right; +} +.fixTable { + width: 40em; + height: 30em; + background: #FFF; +} + + +#user_spot { + display: inline-block; + text-decoration: none; + z-index:5; + padding:0; + margin-left: 9px; + margin-top: 9px; +} +ul#user_spot li { + list-style-type:none; + position:relative; + padding: 5px; + + text-decoration: none; + margin-left: -5px; +} +ul#user_spot li a{ + text-decoration: none; +} +ul#user_spot_links { + list-style-type:none; + position:absolute; + top:20px; + left:-25px; + display:none; + z-index: 6; +} +ul#user_spot_links li { + list-style-type:none; + float: left; + clear:both; + min-width: 140px; + + display: inline-block; + position: relative; + background-color: #EFEFEF; + border: 1px solid #EFEFEF; + white-space: nowrap; + z-index: 7; + text-decoration: none; +} +ul#user_spot_links li a{ + text-decoration: none; + +} +ul#user_spot:hover ul#user_spot_links { + display:block; +} + + +/* PAGINATION */ + +.pagination { + border-top: 0; + margin: 0; + padding: 0.3em 0.2em; + text-align: center; + -moz-box-shadow: 0 0 3px 1px #AAAAAA; + -webkit-box-shadow: 0 0 3px 1px #AAAAAA; + box-shadow: 0 0 3px 1px #AAAAAA; + background-color: #EFEFEF; +} + +.pagination a, +.pagination .currentStep { + color: #666666; + display: inline-block; + margin: 0 0.1em; + padding: 0.25em 0.7em; + text-decoration: none; + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; +} + +.pagination a:hover, .pagination a:focus, +.pagination .currentStep { + background-color: #999999; + color: #ffffff; + outline: none; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8); +} +.bold { + font-weight: bold; + background-color: #CFCFCF; +} +.ui-autocomplete-input, .ui-menu, .ui-menu-item { z-index: 2006; } + +div[class*="bttn"] { + box-sizing: content-box !important; + width: auto; + display: inline-block; + *zoom: 1; + *display: inline; + text-align: center; + outline: none; +} + +.bttn-xs a { + border-radius:0.31px; + -moz-border-radius:0.31px; + -webkit-border-radius:0.31px; + border:1px inset #fff; + list-style-type:none; +} +#onlineUsers >li ,#friendsList > li { text-align: left; list-style-type:none; cursor: pointer; cursor: hand; } + + +.page-header2{padding-bottom:1px;margin:2px 0 3px;border-bottom:1px solid #eeeeee;} +#fixmenu { + padding-top: 10px; +} +.dropdown-submenu{position:relative; z-index: 21;} +.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} +.dropdown-submenu:hover>.dropdown-menu{display:block;} +.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} +.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} +.dropdown-submenu{float:none; }.dropdown-submenu>.dropdown-menu{right:-100%;margin-left:0px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} +.sidebar{float:right;margin-right:1px;} + +#chatFriend{ + background-color: #FEF5CA; +} +#chatOffline{ + background-color: #FEF5CA; +} +#chatOnline{ + background-color: #FDF2EE; +} +#chatBlocked{ + background-color: #FF4040; +} +#chatUser{ + background-color: #FFFFFE; +} +#chatRooms{ + +} + +.btn-inverse { + color: #ffffff; + background-color: #000000; +} Omniref.com Logo HomeBlogContact Us diff --git a/grails-app/assets/stylesheets/chat.css b/grails-app/assets/stylesheets/chat.css index b5fb954..c45577c 100644 --- a/grails-app/assets/stylesheets/chat.css +++ b/grails-app/assets/stylesheets/chat.css @@ -30,25 +30,6 @@ #ownerBar a {background: #000066; color: #FFF;} #ownerBar a:hover { background: #0000CC; color: #FF0000;} -#cmessage{ - float: right; - width: 100%; - min-height: 25em; - height: 25em; - text-align: left; - font-family: monospace; - position: relative; - display: block; - overflow: auto; - margin-top: 2px; - white-space: pre-line; - border-style: solid; - border-width: thin; - border-color: #AAA; - font-size: 1em; - word-wrap: break-word; - resize:both; -} .message-container > .message-north > .message-thread > .message { min-width: 40%; @@ -140,10 +121,6 @@ } -#chatterBox { - left: auto; - right: auto; -} .nickname { color: #f00; @@ -191,256 +168,4 @@ position: absolute; -} - -.page-header2{padding-bottom:1px;margin:2px 0 3px;border-bottom:1px solid #eeeeee;} -#fixmenu { - padding-top: 10px; -} -.dropdown-submenu{position:relative; z-index: 21;} -.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} -.dropdown-submenu:hover>.dropdown-menu{display:block;} -.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} -.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} -.dropdown-submenu{float:none; }.dropdown-submenu>.dropdown-menu{right:-100%;margin-left:0px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} -.sidebar{float:right;margin-right:1px;} - -#chatFriend{ - background-color: #FEF5CA; -} -#chatOffline{ - background-color: #FEF5CA; -} -#chatOnline{ - background-color: #FDF2EE; -} -#chatBlocked{ - background-color: #FF4040; -} -#chatUser{ - background-color: #FFFFFE; -} -#chatRooms{ - -} - -.btn-inverse { - color: #ffffff; - background-color: #000000; -} -#colourthemes{ - position: absolute; - right: 2em; - top: 4em; - float:right; -} -/* webrtc style sheet */ -.section { - width: 100%; - margin: auto; - padding: 2em 1em; - color: #525252; -} -.section.login, -.section.room { - display: block; -} - -/* Video-Stuff */ -.video-wrapper { - width: 100%; - max-width: 50em; - margin: auto; - position: relative; -} -.own-video, -.other-video { - background-color: #F5F5F5; - border: 4px solid #2C5651; - border-radius: 6px; -} -.own-video { - width: 100%; - max-width: 6em; - max-height: 5em; - position: absolute; - right: 1em; - bottom: 1em; -} -.other-video { - height: 100%; - max-height: 30em; - max-width: 100%; -} - -#userInputError { - display:inline-block; - *display:inline; - *zoom:1; -} -#userInput{ - display:inline-block; - *display:inline; - *zoom:1; - width: 180px; -} -#response_image{ - display:inline-block; - *display:inline; - *zoom:1; - width: 24px; - -} -.online { - width: 16px; - height: 16px; - background: url(../images/accept.png) no-repeat 100% 100%; -} - -.offline { - width: 16px; - height: 16px; - background: url(../images/reject.png) no-repeat 100% 100%; -} - -#accept { - width: 16px; - height: 16px; - background: url(../images/accept.png) no-repeat 100% 100%; - display:inline-block; - *display:inline; - *zoom:1; - float:right; -} - -#reject { - width: 16px; - height: 16px; - background: url(../images/reject.png) no-repeat 100% 100%; - display:inline-block; - *display:inline; - *zoom:1; - float:right; -} -#question { - width: 16px; - height: 16px; - background: url(../images/exclamation.png) no-repeat 100% 100%; - display:inline-block; - *display:inline; - *zoom:1; - float:right; -} -.fixTable { - width: 40em; - height: 30em; - background: #FFF; -} - - -#user_spot { - display: inline-block; - text-decoration: none; - z-index:5; - padding:0; - margin-left: 9px; - margin-top: 9px; -} -ul#user_spot li { - list-style-type:none; - position:relative; - padding: 5px; - - text-decoration: none; - margin-left: -5px; -} -ul#user_spot li a{ - text-decoration: none; -} -ul#user_spot_links { - list-style-type:none; - position:absolute; - top:20px; - left:-25px; - display:none; - z-index: 6; -} -ul#user_spot_links li { - list-style-type:none; - float: left; - clear:both; - min-width: 140px; - - display: inline-block; - position: relative; - background-color: #EFEFEF; - border: 1px solid #EFEFEF; - white-space: nowrap; - z-index: 7; - text-decoration: none; -} -ul#user_spot_links li a{ - text-decoration: none; - -} -ul#user_spot:hover ul#user_spot_links { - display:block; -} - - -/* PAGINATION */ - -.pagination { - border-top: 0; - margin: 0; - padding: 0.3em 0.2em; - text-align: center; - -moz-box-shadow: 0 0 3px 1px #AAAAAA; - -webkit-box-shadow: 0 0 3px 1px #AAAAAA; - box-shadow: 0 0 3px 1px #AAAAAA; - background-color: #EFEFEF; -} - -.pagination a, -.pagination .currentStep { - color: #666666; - display: inline-block; - margin: 0 0.1em; - padding: 0.25em 0.7em; - text-decoration: none; - -moz-border-radius: 0.3em; - -webkit-border-radius: 0.3em; - border-radius: 0.3em; -} - -.pagination a:hover, .pagination a:focus, -.pagination .currentStep { - background-color: #999999; - color: #ffffff; - outline: none; - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8); -} -.bold { - font-weight: bold; - background-color: #CFCFCF; -} -.ui-autocomplete-input, .ui-menu, .ui-menu-item { z-index: 2006; } - -div[class*="bttn"] { - box-sizing: content-box !important; - width: auto; - display: inline-block; - *zoom: 1; - *display: inline; - text-align: center; - outline: none; -} - -.bttn-xs a { - border-radius:0.31px; - -moz-border-radius:0.31px; - -webkit-border-radius:0.31px; - border:1px inset #fff; - list-style-type:none; -} -#onlineUsers >li ,#friendsList > li { text-align: left; list-style-type:none; cursor: pointer; cursor: hand; } +} \ No newline at end of file diff --git a/grails-app/controllers/grails/plugin/wschat/WsChatController.groovy b/grails-app/controllers/grails/plugin/wschat/WsChatController.groovy index 4fba9e9..ca07611 100644 --- a/grails-app/controllers/grails/plugin/wschat/WsChatController.groovy +++ b/grails-app/controllers/grails/plugin/wschat/WsChatController.groovy @@ -22,16 +22,16 @@ class WsChatController extends WsChatConfService { def index(ConnectTagBean bean) { bean.addLayouts=true - bean.rooms = config.rooms as ArrayList + bean.setRooms(config.rooms as ArrayList) if (!bean.rooms && (bean.dbSupport)) { - bean.rooms = wsChatRoomService.returnRoom(bean.dbSupport) + bean.setRooms(wsChatRoomService.returnRoom(bean.dbSupport)) } if (bean.process) { render "Default sign in page disabled" return } - [bean:bean, rooms:bean.rooms] + [bean:bean] } def chat(ConnectTagBean bean) { diff --git a/grails-app/controllers/grails/plugin/wschat/client/WsChatClientController.groovy b/grails-app/controllers/grails/plugin/wschat/client/WsChatClientController.groovy index a5989e7..385b7c8 100644 --- a/grails-app/controllers/grails/plugin/wschat/client/WsChatClientController.groovy +++ b/grails-app/controllers/grails/plugin/wschat/client/WsChatClientController.groovy @@ -11,15 +11,23 @@ class WsChatClientController extends WsChatConfService { def index() { [ clientMaster:clientMaster, clientSlave:clientSlave] } - + def masterList() { - render clientMaster as JSON + if (clientMaster) { + render clientMaster as JSON + }else{ + render '' + } } - + def slaveList() { - render clientSlave as JSON + if (clientSlave) { + render clientSlave as JSON + }else{ + render '' + } } - + def showMasters() { render (view: 'index', model: [clientMaster:clientMaster]) } diff --git a/grails-app/services/grails/plugin/wschat/client/WsChatClientService.groovy b/grails-app/services/grails/plugin/wschat/client/WsChatClientService.groovy index 8ecde58..a8d7393 100644 --- a/grails-app/services/grails/plugin/wschat/client/WsChatClientService.groovy +++ b/grails-app/services/grails/plugin/wschat/client/WsChatClientService.groovy @@ -14,10 +14,8 @@ public class WsChatClientService extends WsChatConfService { def wsChatUserService - public WsChatClientEndpoint conn(String hostname, String appName, String room, String user ) { - ConfigBean bean = new ConfigBean() - WsChatClientEndpoint clientEndPoint = - new WsChatClientEndpoint(new URI(bean.uri)) + public WsChatClientEndpoint conn(String uri, String user ) { + WsChatClientEndpoint clientEndPoint = new WsChatClientEndpoint(new URI(uri)) clientEndPoint.connectClient(user) return clientEndPoint } diff --git a/grails-app/taglib/grails/plugin/wschat/WsChatTagLib.groovy b/grails-app/taglib/grails/plugin/wschat/WsChatTagLib.groovy index 4e6bcb1..681fa2c 100644 --- a/grails-app/taglib/grails/plugin/wschat/WsChatTagLib.groovy +++ b/grails-app/taglib/grails/plugin/wschat/WsChatTagLib.groovy @@ -58,11 +58,14 @@ class WsChatTagLib extends WsChatConfService { } } if (!bean.room) { - bean.room = wsChatRoomService.returnRoom(bean.dbSupport, true) + bean.setRoom(wsChatRoomService.returnRoom(bean.dbSupport, true)) } - Map model = [bean:bean] - WsChatClientEndpoint clientEndPoint = wsChatClientService.conn(bean.hostname, bean.appName, bean.room, bean.user) + String uri = "${bean.uri}${bean.room}" + + println "---> $uri ---> @@ " + + WsChatClientEndpoint clientEndPoint = wsChatClientService.conn(uri, bean.user) if (bean.receivers) { //if (strictMode==false) { // wsChatClientService.sendMessage(clientEndPoint, ">>"+message) @@ -78,6 +81,8 @@ class WsChatTagLib extends WsChatConfService { //Session userSess = wsChatClientService.returnSession() //Session userSession = clientEndPoint.returnSession() wsChatClientService.handMessage(clientEndPoint, bean.user, bean.receivers, bean.actionMap, bean.strictMode, bean.divId, bean.masterNode) + Map model = [bean:bean, uri:uri] + if (bean.frontenduser) { if (bean.template) { out << g.render(template:bean.template, model:model) @@ -96,9 +101,9 @@ class WsChatTagLib extends WsChatConfService { } } if (!bean.room) { - bean.room = wsChatRoomService.returnRoom(bean.dbSupport, true) + bean.setRoom(wsChatRoomService.returnRoom(bean.dbSupport, true)) } - Map model = [bean:bean] + Session oSession = chatClientListenerService.p_connect(bean.uri, bean.user, bean.room) try{ //closure(session) @@ -120,6 +125,8 @@ class WsChatTagLib extends WsChatConfService { }catch(e){ //log.error e } + String uri = "${bean.uri}${bean.room}" + Map model = [bean:bean, uri:uri] if (bean.frontenduser) { if (bean.template) { out << g.render(template:bean.template, model:model) diff --git a/grails-app/views/wsChat/_process.gsp b/grails-app/views/wsChat/_process.gsp index 9ea0465..5778ad4 100644 --- a/grails-app/views/wsChat/_process.gsp +++ b/grails-app/views/wsChat/_process.gsp @@ -9,8 +9,8 @@ var receivers="${bean.receivers}" var arrayLength = receivers.length; // Connect websocket and set up processes - console.log('${bean.uri}${bean.room} @@ ${bean.user} >> ${bean.receivers} '); - var webSocket=new WebSocket('${bean.uri}${bean.room}'); + console.log('${bean.uri}${bean.room} @@ ${bean.user} >> ${bean.receivers} ${uri}'); + var webSocket=new WebSocket('${uri}'); webSocket.onopen=function(message) {processOpen(message);}; webSocket.onclose=function(message) {processClose(message);}; webSocket.onerror=function(message) {processError(message);}; diff --git a/grails-app/views/wsChat/index.gsp b/grails-app/views/wsChat/index.gsp index 11331a9..147f3c7 100644 --- a/grails-app/views/wsChat/index.gsp +++ b/grails-app/views/wsChat/index.gsp @@ -27,7 +27,7 @@
Nickname:
- + diff --git a/src/main/groovy/grails/plugin/wschat/beans/ConnectTagBean.groovy b/src/main/groovy/grails/plugin/wschat/beans/ConnectTagBean.groovy index 88767b7..4d87a66 100644 --- a/src/main/groovy/grails/plugin/wschat/beans/ConnectTagBean.groovy +++ b/src/main/groovy/grails/plugin/wschat/beans/ConnectTagBean.groovy @@ -14,12 +14,6 @@ class ConnectTagBean extends InitiationBean implements Validateable { super } - /* - Boolean setAddLayouts(String addLayouts) { - this.addLayouts = addLayouts - return addLayouts - } - */ Boolean getUpdateProfile() { return validateBool(updateProfile) } diff --git a/src/main/groovy/grails/plugin/wschat/client/WsChatClientEndpoint.groovy b/src/main/groovy/grails/plugin/wschat/client/WsChatClientEndpoint.groovy index c72c5ff..601de10 100644 --- a/src/main/groovy/grails/plugin/wschat/client/WsChatClientEndpoint.groovy +++ b/src/main/groovy/grails/plugin/wschat/client/WsChatClientEndpoint.groovy @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory import javax.websocket.* import javax.websocket.server.PathParam +import javax.websocket.ContainerProvider @ClientEndpoint public class WsChatClientEndpoint extends ChatUtils { @@ -32,6 +33,7 @@ public class WsChatClientEndpoint extends ChatUtils { } } + @OnOpen public void handleOpen(Session userSession,EndpointConfig c,@PathParam("room") String room) { this.userSession = userSession diff --git a/src/main/groovy/wschat/DefaultWsChatConfig.groovy b/src/main/groovy/wschat/DefaultWsChatConfig.groovy index f204069..b4640dc 100644 --- a/src/main/groovy/wschat/DefaultWsChatConfig.groovy +++ b/src/main/groovy/wschat/DefaultWsChatConfig.groovy @@ -17,17 +17,11 @@ class DefaultWsChatConfig { return new ServletContextInitializer() { @Override public void onStartup(ServletContext servletContext) throws ServletException { + servletContext.addListener(WsChatEndpoint) servletContext.addListener(WsCamEndpoint) servletContext.addListener(WsChatFileEndpoint) - } } } - // Alternative way - @Bean - public ServletListenerRegistrationBean httpSessionEventPublisher() { - return new ServletListenerRegistrationBean(new WsChatEndpoint()) - - } }