You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2015/11/24 09:23:58 UTC
svn commit: r1716064 - in /openmeetings/branches/3.1.x/openmeetings-flash:
./ src/main/swf/modules/chat/
src/main/swf/modules/conference/tabcontent/chat/ src/main/swf/test/
Author: solomax
Date: Tue Nov 24 08:23:58 2015
New Revision: 1716064
URL: http://svn.apache.org/viewvc?rev=1716064&view=rev
Log:
[OPENMEETINGS-1279] chat seems to work as expected
Removed:
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/test/testLineWidth.lzx
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/test/testLineWidth.lzx.lzr=swf8.swf
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/test/testLoadSWF.lzx.lzr=swf8.swf
Modified:
openmeetings/branches/3.1.x/openmeetings-flash/openlaszlo.xml
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/chat/globalMethods.lzx
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabBottom.lzx
openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabItemEmoticons.lzx
Modified: openmeetings/branches/3.1.x/openmeetings-flash/openlaszlo.xml
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/openlaszlo.xml?rev=1716064&r1=1716063&r2=1716064&view=diff
==============================================================================
--- openmeetings/branches/3.1.x/openmeetings-flash/openlaszlo.xml (original)
+++ openmeetings/branches/3.1.x/openmeetings-flash/openlaszlo.xml Tue Nov 24 08:23:58 2015
@@ -104,9 +104,9 @@
</target>
<target name="-retrieve-openlaszlo46" unless="laszlo46.installed" description="Retrieves the libraries if needed" depends="-availability-check">
<mkdir dir="${openlaszlo}"/>
- <get src="https://dl.bintray.com/openmeetings/maven/org/openlaszlo/openlaszlo/4.9.5/openlaszlo-4.9.5.tgz"
+ <get src="https://dl.bintray.com/openmeetings/maven/org/openlaszlo/openlaszlo/4.9.6/openlaszlo-4.9.6.tgz"
dest="${openlaszlo}" usetimestamp="true"/>
- <untar src="${openlaszlo}/openlaszlo-4.9.5.tgz" dest="${openlaszlo}" compression="gzip" />
+ <untar src="${openlaszlo}/openlaszlo-4.9.6.tgz" dest="${openlaszlo}" compression="gzip" />
<chmod dir="${laszlo46.home}/WEB-INF/flexsdk" perm="755" includes="**/mxmlc*" />
<delete>
<fileset dir="${openlaszlo}" includes="openlaszlo*.tgz"/>
Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/chat/globalMethods.lzx
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/chat/globalMethods.lzx?rev=1716064&r1=1716063&r2=1716064&view=diff
==============================================================================
--- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/chat/globalMethods.lzx (original)
+++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/chat/globalMethods.lzx Tue Nov 24 08:23:58 2015
@@ -22,145 +22,6 @@
<!-- global methods for chat module -->
<library>
-<script>
-<![CDATA[
-
- // global chat history array for all chat module
- this.chathistory=new Array();
-
-var maxsize = 220;
-var textFieldtext = "";
-var startIndex = 0;
-var currentLine = 0;
-var textObject = null;
-var myTextFormat = null;
-var lineHeight = 0;
-
-function calcLineWidthByTextField(maxsizeText,textForCalcing,fontsize, fontname){
- //check test/testLineWidth.lzx in test-directory for a detailed example calculation
- //if ($debug) Debug.write("calcLineWidthByTextField: ",textForCalcing);
-
- maxsize = maxsizeText;
- startIndex = 0;
- currentLine = 0;
- textObject = new Array();
-
- if ($debug) Debug.write("textObject", textObject);
- textFieldtext = textForCalcing;
- myTextFormat = new TextFormat();
- myTextFormat.size = fontsize;
- myTextFormat.font = fontname;
- if ($debug) Debug.write("myTextFormat", myTextFormat);
-
- var metrics = myTextFormat.getTextExtent(textFieldtext, 100000);
- if ($debug) Debug.write("metrics", metrics);
- lineHeight = metrics.ascent+metrics.descent;
- //if ($debug) Debug.write(lineHeight);
-
- measureLine();
-
- return textObject;
-}
-
-function measureLine(){
- var remainingLength = textFieldtext.length;
-
- var testTxt = "";
- var testTxt2 = "";
- var textFieldtext2 = textFieldtext;
- var metrics = 0;
- var firstSpaceIndex = 0;
- var isFirstWord = true;
-
- //if ($debug) Debug.write("FUNC/chat Message: ", textFieldtext);
- //if ($debug) Debug.write("FUNC/length of chat Message: ", remainingLength);
-
- while (remainingLength > 0) {
- testTxt = "";
- testTxt2 = "";
- textFieldtext2 = textFieldtext;
- metrics = myTextFormat.getTextExtent(textFieldtext2, 100000);
- isFirstWord = true;
-
- //if ($debug) Debug.write("size of the current part: ", metrics.width);
- do {
- firstSpaceIndex = textFieldtext2.indexOf(" ");
- testTxt2 = testTxt;
-
- if (firstSpaceIndex != -1) {
- //if ($debug) Debug.write("the first space is at position: ", firstSpaceIndex);
- if (isFirstWord) {
- testTxt = textFieldtext2.slice(startIndex, firstSpaceIndex);
- isFirstWord = false;
- } else {
- testTxt = testTxt + " " + textFieldtext2.slice(startIndex, firstSpaceIndex);
- }
- textFieldtext2 = textFieldtext2.slice(firstSpaceIndex + 1, textFieldtext2.length);
- metrics = myTextFormat.getTextExtent(testTxt, 100000);
- } else {
- // this is the last word
- //if ($debug) Debug.write("this is the last word!");
- testTxt = testTxt + " " + textFieldtext2;
- metrics = myTextFormat.getTextExtent(testTxt, 100000);
- if (isFirstWord && metrics.width < maxsize) {
- testTxt2 = testTxt;
- isFirstWord = false;
- }
- break;
- }
- } while (metrics.width < maxsize)
-
- if (metrics.width < maxsize) {
- testTxt2 = testTxt;
- }
-
- if (testTxt2.length == 0) {
- // the first word is already too long
- //if ($debug) Debug.write("the first word is already too long!");
- testTxt = "";
- textFieldtext2 = textFieldtext;
- metrics = myTextFormat.getTextExtent(testTxt, 100000);
- isFirstWord = true;
-
- while (metrics.width < maxsize) {
- testTxt = testTxt + textFieldtext2.slice(startIndex, 1);
- textFieldtext2 = textFieldtext2.slice(1, remainingLength);
- metrics = myTextFormat.getTextExtent(testTxt, 100000);
- }
-
- testTxt2 = testTxt;
- }
-
- textObject[currentLine] = new Array();
- textObject[currentLine]["text"] = testTxt2;
- var metrics2 = myTextFormat.getTextExtent(textObject[currentLine]["text"], 100000);
- textObject[currentLine]["lineWidth"] = metrics2.width;
- currentLine += 1;
- //if ($debug) Debug.write("new line: ", textObject[currentLine]["text"]);
-
- textFieldtext = textFieldtext.slice(testTxt2.length, textFieldtext.length)
- if (textFieldtext.indexOf(" ") == 0) {
- textFieldtext = textFieldtext.slice(1, textFieldtext.length)
- }
- remainingLength = textFieldtext.length;
-
- //if ($debug) Debug.write("remaining text: ", textFieldtext);
- }
-}
-
-function getLineHeight(){
- return lineHeight;
-}
-
-
-
-
-]]>
-</script>
-
-
-
-
<method name="addChatHistory" args="value,client">
<![CDATA[
if ($debug) Debug.write("addChatHistory: ", value,client);
Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabBottom.lzx
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabBottom.lzx?rev=1716064&r1=1716063&r2=1716064&view=diff
==============================================================================
--- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabBottom.lzx (original)
+++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabBottom.lzx Tue Nov 24 08:23:58 2015
@@ -26,7 +26,7 @@
<view x="0" y="0" height="20" width="${ parent.width-2 }" name="message"
bgcolor="$once{ canvas.getThemeColor('basebgcolorizer') }">
<method name="getText">
- return this._ctext.getText();
+ return this._ctext.text;
</method>
<method name="setText" args="txt">
this._ctext.setAttribute('text',txt);
@@ -35,8 +35,6 @@
height="$once{ parent.height-2 }" x="1" y="1" bgcolor="white">
<handler name="onkeyup" args="key">
<![CDATA[
- var reverse = canvas.reverseAll(parent.getText());
-
// parent.setText(reverse);
// 13 is return
if ((key==27) || (key==13)) {
Modified: openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabItemEmoticons.lzx
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabItemEmoticons.lzx?rev=1716064&r1=1716063&r2=1716064&view=diff
==============================================================================
--- openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabItemEmoticons.lzx (original)
+++ openmeetings/branches/3.1.x/openmeetings-flash/src/main/swf/modules/conference/tabcontent/chat/chatTabItemEmoticons.lzx Tue Nov 24 08:23:58 2015
@@ -22,6 +22,14 @@
<class name="chatTabItemEmoticons" extends="view" width="$once{ parent.width }" bgcolor="$once{ this.usercolor }">
+ <switch>
+ <when property="$as3">
+ <passthrough>
+ import flash.text.*;
+ import fl.text.*;
+ </passthrough>
+ </when>
+ </switch>
<attribute name="userId" value="0" type="number" />
<attribute name="username" value="" type="string" />
@@ -35,22 +43,51 @@
<attribute name="rawMessage" value="null" />
<handler name="oninit">
- <![CDATA[
- if ($debug) Debug.write("this.picture_uri :: ",this.picture_uri);
- this._userpic.setAttribute('src', canvas.getPictureUrl(this.picture_uri, '&moduleName=chat&remoteUserid='+this.userId));
-
- if(canvas.isrtl == 'true'){
- if($debug) Debug.write("chatTabItemEmoticons RTL is set");
-
- this.header_user.setAttribute('textalign', 'right');
- this.header_time.setAttribute('align', 'left');
- this.header_time.setAttribute('x', '40');
- this.multi.setAttribute('textalign', 'right');
- this.multi.setAttribute('align', 'right');
- }
-
- //Debug.write("TIME: "+this.usertime);
- ]]>
+ <![CDATA[
+ if ($debug) Debug.write("this.picture_uri :: ",this.picture_uri);
+ this._userpic.setAttribute('src', canvas.getPictureUrl(this.picture_uri, '&moduleName=chat&remoteUserid='+this.userId));
+
+ if (canvas.isrtl == 'true') {
+ if($debug) Debug.write("chatTabItemEmoticons RTL is set");
+
+ this.header_user.setAttribute('textalign', 'right');
+ this.header_time.setAttribute('align', 'left');
+ this.header_time.setAttribute('x', '40');
+ }
+ this.multi = new TLFTextField();
+ if ($debug) Debug.write("New Text ", this, this.multi);
+
+ var tFormat:TextFormat = new TextFormat();
+ tFormat.leading = 4;
+ tFormat.size = 11;
+ var items = messageObj;
+ if ($debug) Debug.write("items :: ", items, this.leading);
+ var t = "";
+ for (var i = 0; i < items.length; ++i) {
+ if (items[i][0] == "text") {
+ //if ($debug) Debug.write("Text :1: ",items[i][1]);
+ t += items[i][1];
+ } else {
+ t += "<img src='" + canvas.getUrl() + "public/emoticons/" + items[i][1] + "' alt='" + items[i][3] + "' width='16' height='16' />";
+ }
+ }
+
+ this.multi.wordWrap = true;
+ this.multi.multiline = true;
+ this.multi.selectable = true;
+ this.multi.defaultTextFormat = tFormat;
+ this.multi.x = 180;
+ this.multi.width = this.width - 306;
+ this.multi.direction = canvas.isrtl ? 'rtl' : 'ltr';
+ this.multi.htmlText = t;
+ this.multi.height = this.multi.textHeight + 12;
+
+ this.header_user.setAttribute('height', this.multi.height);
+ this.bg.setAttribute('height', this.multi.height - 1);
+ this.bg_main.setAttribute('height', this.multi.height - 1);
+ if ($debug) Debug.write("chatTabItemEmoticons::oninit 4", this.multi.width, this.multi.textHeight);
+ this.sprite.addChild(this.multi);
+ ]]>
</handler>
<view name="bg" width="179" height="$once{ parent.height-1 }" bgcolor="0xFFFFFF"
@@ -114,57 +151,6 @@
opacity="0.3" bgcolor="0xFFFFFF">
</view>
- <text multiline="true" x="180" width="$once{ parent.width - 306 }" fontsize="11" selectable="true" name="multi" direction="$once{ canvas.isrtl ? 'rtl' : 'ltr' }">
- <switch>
- <when property="$as3">
- <passthrough>
- import flash.text.*;
- </passthrough>
- </when>
- </switch>
- <handler name="oninit">
- <![CDATA[
- var tf:TextField = this.sprite['textfield'];
- if ($debug) Debug.write("New Text ", this, tf, tf.wordWrap, tf.getTextFormat());
- if (!canvas.isrtl) {
- tf.wordWrap = false;
- var tFormat:TextFormat = tf.getTextFormat();
- tFormat.leading = 4;
- tf.setTextFormat(tFormat);
- var items = parent.messageObj;
- if ($debug) Debug.write("items :: ", items, parent.leading);
- var t = "";
- for (var i = 0; i < items.length; ++i) {
- if (items[i][0] == "text") {
- //if ($debug) Debug.write("Text :1: ",items[i][1]);
- t += items[i][1];
- } else {
- t += "<img src='" + canvas.getUrl() + 'public/emoticons/'+items[i][1] + "' alt='" + items[i][3] + "'/>"; //items[i][2];
- }
- }
-
- tFormat.leading = parent.leading;
- tf.setTextFormat(tFormat);
- if ($debug) Debug.write("text::oninit 0");
- } else {
- var t = "";
- var items = parent.messageObj;
-
- for (var i = 0; i < items.length; ++i) {
- if (items[i][0] == "text") {
- t += items[i][1];
- }
- }
- }
- this.setAttribute('text', t);
- parent.header_user.setAttribute('height', this.height);
- parent.bg.setAttribute('height', this.height - 1);
- parent.bg_main.setAttribute('height', this.height - 1);
- if ($debug) Debug.write("text::oninit 4", t, this, parent);
- ]]>
- </handler>
- </text>
-
<state applied="$once{ !parent.isDirectLink }">
<miniIcons name="private_message_add" resource="private_message_add_rsc" width="16" height="16"