diff --git a/akka-bbb-apps/src/main/java/.gitkeep b/akka-bbb-apps/src/main/java/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/akka-bbb-apps/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java b/akka-bbb-apps/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java deleted file mode 100644 index 24ffdacacaf03ec0f0c3036f6f6f5f4e826942c2..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java +++ /dev/null @@ -1,2420 +0,0 @@ -/* - * Diff Match and Patch - * - * Copyright 2006 Google Inc. - * http://code.google.com/p/google-diff-match-patch/ - * - * 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. - */ - -package name.fraser.neil.plaintext; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Set; -import java.util.Stack; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/* - * Functions for diff, match and patch. - * Computes the difference between two texts to create a patch. - * Applies the patch onto another text, allowing for errors. - * - * @author fraser@google.com (Neil Fraser) - */ - -/** - * Class containing the diff, match and patch methods. - * Also contains the behaviour settings. - */ -public class diff_match_patch { - - // Defaults. - // Set these on your diff_match_patch instance to override the defaults. - - /** - * Number of seconds to map a diff before giving up (0 for infinity). - */ - public float Diff_Timeout = 1.0f; - /** - * Cost of an empty edit operation in terms of edit characters. - */ - public short Diff_EditCost = 4; - /** - * The size beyond which the double-ended diff activates. - * Double-ending is twice as fast, but less accurate. - */ - public short Diff_DualThreshold = 32; - /** - * At what point is no match declared (0.0 = perfection, 1.0 = very loose). - */ - public float Match_Threshold = 0.5f; - /** - * How far to search for a match (0 = exact location, 1000+ = broad match). - * A match this many characters away from the expected location will add - * 1.0 to the score (0.0 is a perfect match). - */ - public int Match_Distance = 1000; - /** - * When deleting a large block of text (over ~64 characters), how close does - * the contents have to match the expected contents. (0.0 = perfection, - * 1.0 = very loose). Note that Match_Threshold controls how closely the - * end points of a delete need to match. - */ - public float Patch_DeleteThreshold = 0.5f; - /** - * Chunk size for context length. - */ - public short Patch_Margin = 4; - - /** - * The number of bits in an int. - */ - private int Match_MaxBits = 32; - - /** - * Internal class for returning results from diff_linesToChars(). - * Other less paranoid languages just use a three-element array. - */ - protected static class LinesToCharsResult { - protected String chars1; - protected String chars2; - protected List<String> lineArray; - - protected LinesToCharsResult(String chars1, String chars2, - List<String> lineArray) { - this.chars1 = chars1; - this.chars2 = chars2; - this.lineArray = lineArray; - } - } - - - // DIFF FUNCTIONS - - - /** - * The data structure representing a diff is a Linked list of Diff objects: - * {Diff(Operation.DELETE, "Hello"), Diff(Operation.INSERT, "Goodbye"), - * Diff(Operation.EQUAL, " world.")} - * which means: delete "Hello", add "Goodbye" and keep " world." - */ - public enum Operation { - DELETE, INSERT, EQUAL - } - - - /** - * Find the differences between two texts. - * Run a faster slightly less optimal diff - * This method allows the 'checklines' of diff_main() to be optional. - * Most of the time checklines is wanted, so default to true. - * @param text1 Old string to be diffed. - * @param text2 New string to be diffed. - * @return Linked List of Diff objects. - */ - public LinkedList<Diff> diff_main(String text1, String text2) { - return diff_main(text1, text2, true); - } - - /** - * Find the differences between two texts. Simplifies the problem by - * stripping any common prefix or suffix off the texts before diffing. - * @param text1 Old string to be diffed. - * @param text2 New string to be diffed. - * @param checklines Speedup flag. If false, then don't run a - * line-level diff first to identify the changed areas. - * If true, then run a faster slightly less optimal diff - * @return Linked List of Diff objects. - */ - public LinkedList<Diff> diff_main(String text1, String text2, - boolean checklines) { - // Check for equality (speedup) - LinkedList<Diff> diffs; - if (text1.equals(text2)) { - diffs = new LinkedList<Diff>(); - diffs.add(new Diff(Operation.EQUAL, text1)); - return diffs; - } - - // Trim off common prefix (speedup) - int commonlength = diff_commonPrefix(text1, text2); - String commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup) - commonlength = diff_commonSuffix(text1, text2); - String commonsuffix = text1.substring(text1.length() - commonlength); - text1 = text1.substring(0, text1.length() - commonlength); - text2 = text2.substring(0, text2.length() - commonlength); - - // Compute the diff on the middle block - diffs = diff_compute(text1, text2, checklines); - - // Restore the prefix and suffix - if (commonprefix.length() != 0) { - diffs.addFirst(new Diff(Operation.EQUAL, commonprefix)); - } - if (commonsuffix.length() != 0) { - diffs.addLast(new Diff(Operation.EQUAL, commonsuffix)); - } - - diff_cleanupMerge(diffs); - return diffs; - } - - - /** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param text1 Old string to be diffed. - * @param text2 New string to be diffed. - * @param checklines Speedup flag. If false, then don't run a - * line-level diff first to identify the changed areas. - * If true, then run a faster slightly less optimal diff - * @return Linked List of Diff objects. - */ - protected LinkedList<Diff> diff_compute(String text1, String text2, - boolean checklines) { - LinkedList<Diff> diffs = new LinkedList<Diff>(); - - if (text1.length() == 0) { - // Just add some text (speedup) - diffs.add(new Diff(Operation.INSERT, text2)); - return diffs; - } - - if (text2.length() == 0) { - // Just delete some text (speedup) - diffs.add(new Diff(Operation.DELETE, text1)); - return diffs; - } - - String longtext = text1.length() > text2.length() ? text1 : text2; - String shorttext = text1.length() > text2.length() ? text2 : text1; - int i = longtext.indexOf(shorttext); - if (i != -1) { - // Shorter text is inside the longer text (speedup) - Operation op = (text1.length() > text2.length()) ? - Operation.DELETE : Operation.INSERT; - diffs.add(new Diff(op, longtext.substring(0, i))); - diffs.add(new Diff(Operation.EQUAL, shorttext)); - diffs.add(new Diff(op, longtext.substring(i + shorttext.length()))); - return diffs; - } - longtext = shorttext = null; // Garbage collect. - - // Check to see if the problem can be split in two. - String[] hm = diff_halfMatch(text1, text2); - if (hm != null) { - // A half-match was found, sort out the return data. - String text1_a = hm[0]; - String text1_b = hm[1]; - String text2_a = hm[2]; - String text2_b = hm[3]; - String mid_common = hm[4]; - // Send both pairs off for separate processing. - LinkedList<Diff> diffs_a = diff_main(text1_a, text2_a, checklines); - LinkedList<Diff> diffs_b = diff_main(text1_b, text2_b, checklines); - // Merge the results. - diffs = diffs_a; - diffs.add(new Diff(Operation.EQUAL, mid_common)); - diffs.addAll(diffs_b); - return diffs; - } - - // Perform a real diff. - if (checklines && (text1.length() < 100 || text2.length() < 100)) { - checklines = false; // Too trivial for the overhead. - } - List<String> linearray = null; - if (checklines) { - // Scan the text on a line-by-line basis first. - LinesToCharsResult b = diff_linesToChars(text1, text2); - text1 = b.chars1; - text2 = b.chars2; - linearray = b.lineArray; - } - - diffs = diff_map(text1, text2); - if (diffs == null) { - // No acceptable result. - diffs = new LinkedList<Diff>(); - diffs.add(new Diff(Operation.DELETE, text1)); - diffs.add(new Diff(Operation.INSERT, text2)); - } - - if (checklines) { - // Convert the diff back to original text. - diff_charsToLines(diffs, linearray); - // Eliminate freak matches (e.g. blank lines) - diff_cleanupSemantic(diffs); - - // Rediff any replacement blocks, this time character-by-character. - // Add a dummy entry at the end. - diffs.add(new Diff(Operation.EQUAL, "")); - int count_delete = 0; - int count_insert = 0; - String text_delete = ""; - String text_insert = ""; - ListIterator<Diff> pointer = diffs.listIterator(); - Diff thisDiff = pointer.next(); - while (thisDiff != null) { - switch (thisDiff.operation) { - case INSERT: - count_insert++; - text_insert += thisDiff.text; - break; - case DELETE: - count_delete++; - text_delete += thisDiff.text; - break; - case EQUAL: - // Upon reaching an equality, check for prior redundancies. - if (count_delete >= 1 && count_insert >= 1) { - // Delete the offending records and add the merged ones. - pointer.previous(); - for (int j = 0; j < count_delete + count_insert; j++) { - pointer.previous(); - pointer.remove(); - } - for (Diff newDiff : diff_main(text_delete, text_insert, false)) { - pointer.add(newDiff); - } - } - count_insert = 0; - count_delete = 0; - text_delete = ""; - text_insert = ""; - break; - } - thisDiff = pointer.hasNext() ? pointer.next() : null; - } - diffs.removeLast(); // Remove the dummy entry at the end. - } - return diffs; - } - - - /** - * Split two texts into a list of strings. Reduce the texts to a string of - * hashes where each Unicode character represents one line. - * @param text1 First string. - * @param text2 Second string. - * @return An object containing the encoded text1, the encoded text2 and - * the List of unique strings. The zeroth element of the List of - * unique strings is intentionally blank. - */ - protected LinesToCharsResult diff_linesToChars(String text1, String text2) { - List<String> lineArray = new ArrayList<String>(); - Map<String, Integer> lineHash = new HashMap<String, Integer>(); - // e.g. linearray[4] == "Hello\n" - // e.g. linehash.get("Hello\n") == 4 - - // "\x00" is a valid character, but various debuggers don't like it. - // So we'll insert a junk entry to avoid generating a null character. - lineArray.add(""); - - String chars1 = diff_linesToCharsMunge(text1, lineArray, lineHash); - String chars2 = diff_linesToCharsMunge(text2, lineArray, lineHash); - return new LinesToCharsResult(chars1, chars2, lineArray); - } - - - /** - * Split a text into a list of strings. Reduce the texts to a string of - * hashes where each Unicode character represents one line. - * @param text String to encode. - * @param lineArray List of unique strings. - * @param lineHash Map of strings to indices. - * @return Encoded string. - */ - private String diff_linesToCharsMunge(String text, List<String> lineArray, - Map<String, Integer> lineHash) { - int lineStart = 0; - int lineEnd = -1; - String line; - StringBuilder chars = new StringBuilder(); - // Walk the text, pulling out a substring for each line. - // text.split('\n') would would temporarily double our memory footprint. - // Modifying text would create many large strings to garbage collect. - while (lineEnd < text.length() - 1) { - lineEnd = text.indexOf('\n', lineStart); - if (lineEnd == -1) { - lineEnd = text.length() - 1; - } - line = text.substring(lineStart, lineEnd + 1); - lineStart = lineEnd + 1; - - if (lineHash.containsKey(line)) { - chars.append(String.valueOf((char) (int) lineHash.get(line))); - } else { - lineArray.add(line); - lineHash.put(line, lineArray.size() - 1); - chars.append(String.valueOf((char) (lineArray.size() - 1))); - } - } - return chars.toString(); - } - - - /** - * Rehydrate the text in a diff from a string of line hashes to real lines of - * text. - * @param diffs LinkedList of Diff objects. - * @param lineArray List of unique strings. - */ - protected void diff_charsToLines(LinkedList<Diff> diffs, - List<String> lineArray) { - StringBuilder text; - for (Diff diff : diffs) { - text = new StringBuilder(); - for (int y = 0; y < diff.text.length(); y++) { - text.append(lineArray.get(diff.text.charAt(y))); - } - diff.text = text.toString(); - } - } - - - /** - * Explore the intersection points between the two texts. - * @param text1 Old string to be diffed. - * @param text2 New string to be diffed. - * @return LinkedList of Diff objects or null if no diff available. - */ - protected LinkedList<Diff> diff_map(String text1, String text2) { - long ms_end = System.currentTimeMillis() + (long) (Diff_Timeout * 1000); - // Cache the text lengths to prevent multiple calls. - int text1_length = text1.length(); - int text2_length = text2.length(); - int max_d = text1_length + text2_length - 1; - boolean doubleEnd = Diff_DualThreshold * 2 < max_d; - List<Set<Long>> v_map1 = new ArrayList<Set<Long>>(); - List<Set<Long>> v_map2 = new ArrayList<Set<Long>>(); - Map<Integer, Integer> v1 = new HashMap<Integer, Integer>(); - Map<Integer, Integer> v2 = new HashMap<Integer, Integer>(); - v1.put(1, 0); - v2.put(1, 0); - int x, y; - Long footstep = 0L; // Used to track overlapping paths. - Map<Long, Integer> footsteps = new HashMap<Long, Integer>(); - boolean done = false; - // If the total number of characters is odd, then the front path will - // collide with the reverse path. - boolean front = ((text1_length + text2_length) % 2 == 1); - for (int d = 0; d < max_d; d++) { - // Bail out if timeout reached. - if (Diff_Timeout > 0 && System.currentTimeMillis() > ms_end) { - return null; - } - - // Walk the front path one step. - v_map1.add(new HashSet<Long>()); // Adds at index 'd'. - for (int k = -d; k <= d; k += 2) { - if (k == -d || k != d && v1.get(k - 1) < v1.get(k + 1)) { - x = v1.get(k + 1); - } else { - x = v1.get(k - 1) + 1; - } - y = x - k; - if (doubleEnd) { - footstep = diff_footprint(x, y); - if (front && (footsteps.containsKey(footstep))) { - done = true; - } - if (!front) { - footsteps.put(footstep, d); - } - } - while (!done && x < text1_length && y < text2_length - && text1.charAt(x) == text2.charAt(y)) { - x++; - y++; - if (doubleEnd) { - footstep = diff_footprint(x, y); - if (front && (footsteps.containsKey(footstep))) { - done = true; - } - if (!front) { - footsteps.put(footstep, d); - } - } - } - v1.put(k, x); - v_map1.get(d).add(diff_footprint(x, y)); - if (x == text1_length && y == text2_length) { - // Reached the end in single-path mode. - return diff_path1(v_map1, text1, text2); - } else if (done) { - // Front path ran over reverse path. - v_map2 = v_map2.subList(0, footsteps.get(footstep) + 1); - LinkedList<Diff> a = diff_path1(v_map1, text1.substring(0, x), - text2.substring(0, y)); - a.addAll(diff_path2(v_map2, text1.substring(x), text2.substring(y))); - return a; - } - } - - if (doubleEnd) { - // Walk the reverse path one step. - v_map2.add(new HashSet<Long>()); // Adds at index 'd'. - for (int k = -d; k <= d; k += 2) { - if (k == -d || k != d && v2.get(k - 1) < v2.get(k + 1)) { - x = v2.get(k + 1); - } else { - x = v2.get(k - 1) + 1; - } - y = x - k; - footstep = diff_footprint(text1_length - x, text2_length - y); - if (!front && (footsteps.containsKey(footstep))) { - done = true; - } - if (front) { - footsteps.put(footstep, d); - } - while (!done && x < text1_length && y < text2_length - && text1.charAt(text1_length - x - 1) - == text2.charAt(text2_length - y - 1)) { - x++; - y++; - footstep = diff_footprint(text1_length - x, text2_length - y); - if (!front && (footsteps.containsKey(footstep))) { - done = true; - } - if (front) { - footsteps.put(footstep, d); - } - } - v2.put(k, x); - v_map2.get(d).add(diff_footprint(x, y)); - if (done) { - // Reverse path ran over front path. - v_map1 = v_map1.subList(0, footsteps.get(footstep) + 1); - LinkedList<Diff> a - = diff_path1(v_map1, text1.substring(0, text1_length - x), - text2.substring(0, text2_length - y)); - a.addAll(diff_path2(v_map2, text1.substring(text1_length - x), - text2.substring(text2_length - y))); - return a; - } - } - } - } - // Number of diffs equals number of characters, no commonality at all. - return null; - } - - - /** - * Work from the middle back to the start to determine the path. - * @param v_map List of path sets. - * @param text1 Old string fragment to be diffed. - * @param text2 New string fragment to be diffed. - * @return LinkedList of Diff objects. - */ - protected LinkedList<Diff> diff_path1(List<Set<Long>> v_map, - String text1, String text2) { - LinkedList<Diff> path = new LinkedList<Diff>(); - int x = text1.length(); - int y = text2.length(); - Operation last_op = null; - for (int d = v_map.size() - 2; d >= 0; d--) { - while (true) { - if (v_map.get(d).contains(diff_footprint(x - 1, y))) { - x--; - if (last_op == Operation.DELETE) { - path.getFirst().text = text1.charAt(x) + path.getFirst().text; - } else { - path.addFirst(new Diff(Operation.DELETE, - text1.substring(x, x + 1))); - } - last_op = Operation.DELETE; - break; - } else if (v_map.get(d).contains(diff_footprint(x, y - 1))) { - y--; - if (last_op == Operation.INSERT) { - path.getFirst().text = text2.charAt(y) + path.getFirst().text; - } else { - path.addFirst(new Diff(Operation.INSERT, - text2.substring(y, y + 1))); - } - last_op = Operation.INSERT; - break; - } else { - x--; - y--; - assert (text1.charAt(x) == text2.charAt(y)) - : "No diagonal. Can't happen. (diff_path1)"; - if (last_op == Operation.EQUAL) { - path.getFirst().text = text1.charAt(x) + path.getFirst().text; - } else { - path.addFirst(new Diff(Operation.EQUAL, text1.substring(x, x + 1))); - } - last_op = Operation.EQUAL; - } - } - } - return path; - } - - - /** - * Work from the middle back to the end to determine the path. - * @param v_map List of path sets. - * @param text1 Old string fragment to be diffed. - * @param text2 New string fragment to be diffed. - * @return LinkedList of Diff objects. - */ - protected LinkedList<Diff> diff_path2(List<Set<Long>> v_map, - String text1, String text2) { - LinkedList<Diff> path = new LinkedList<Diff>(); - int x = text1.length(); - int y = text2.length(); - Operation last_op = null; - for (int d = v_map.size() - 2; d >= 0; d--) { - while (true) { - if (v_map.get(d).contains(diff_footprint(x - 1, y))) { - x--; - if (last_op == Operation.DELETE) { - path.getLast().text += text1.charAt(text1.length() - x - 1); - } else { - path.addLast(new Diff(Operation.DELETE, - text1.substring(text1.length() - x - 1, text1.length() - x))); - } - last_op = Operation.DELETE; - break; - } else if (v_map.get(d).contains(diff_footprint(x, y - 1))) { - y--; - if (last_op == Operation.INSERT) { - path.getLast().text += text2.charAt(text2.length() - y - 1); - } else { - path.addLast(new Diff(Operation.INSERT, - text2.substring(text2.length() - y - 1, text2.length() - y))); - } - last_op = Operation.INSERT; - break; - } else { - x--; - y--; - assert (text1.charAt(text1.length() - x - 1) - == text2.charAt(text2.length() - y - 1)) - : "No diagonal. Can't happen. (diff_path2)"; - if (last_op == Operation.EQUAL) { - path.getLast().text += text1.charAt(text1.length() - x - 1); - } else { - path.addLast(new Diff(Operation.EQUAL, - text1.substring(text1.length() - x - 1, text1.length() - x))); - } - last_op = Operation.EQUAL; - } - } - } - return path; - } - - - /** - * Compute a good hash of two integers. - * @param x First int. - * @param y Second int. - * @return A long made up of both ints. - */ - protected long diff_footprint(int x, int y) { - // The maximum size for a long is 9,223,372,036,854,775,807 - // The maximum size for an int is 2,147,483,647 - // Two ints fit nicely in one long. - long result = x; - result = result << 32; - result += y; - return result; - } - - - /** - * Determine the common prefix of two strings - * @param text1 First string. - * @param text2 Second string. - * @return The number of characters common to the start of each string. - */ - public int diff_commonPrefix(String text1, String text2) { - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - int n = Math.min(text1.length(), text2.length()); - for (int i = 0; i < n; i++) { - if (text1.charAt(i) != text2.charAt(i)) { - return i; - } - } - return n; - } - - - /** - * Determine the common suffix of two strings - * @param text1 First string. - * @param text2 Second string. - * @return The number of characters common to the end of each string. - */ - public int diff_commonSuffix(String text1, String text2) { - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - int text1_length = text1.length(); - int text2_length = text2.length(); - int n = Math.min(text1_length, text2_length); - for (int i = 1; i <= n; i++) { - if (text1.charAt(text1_length - i) != text2.charAt(text2_length - i)) { - return i - 1; - } - } - return n; - } - - - /** - * Do the two texts share a substring which is at least half the length of - * the longer text? - * @param text1 First string. - * @param text2 Second string. - * @return Five element String array, containing the prefix of text1, the - * suffix of text1, the prefix of text2, the suffix of text2 and the - * common middle. Or null if there was no match. - */ - protected String[] diff_halfMatch(String text1, String text2) { - String longtext = text1.length() > text2.length() ? text1 : text2; - String shorttext = text1.length() > text2.length() ? text2 : text1; - if (longtext.length() < 10 || shorttext.length() < 1) { - return null; // Pointless. - } - - // First check if the second quarter is the seed for a half-match. - String[] hm1 = diff_halfMatchI(longtext, shorttext, - (longtext.length() + 3) / 4); - // Check again based on the third quarter. - String[] hm2 = diff_halfMatchI(longtext, shorttext, - (longtext.length() + 1) / 2); - String[] hm; - if (hm1 == null && hm2 == null) { - return null; - } else if (hm2 == null) { - hm = hm1; - } else if (hm1 == null) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length() > hm2[4].length() ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - if (text1.length() > text2.length()) { - return hm; - //return new String[]{hm[0], hm[1], hm[2], hm[3], hm[4]}; - } else { - return new String[]{hm[2], hm[3], hm[0], hm[1], hm[4]}; - } - } - - - /** - * Does a substring of shorttext exist within longtext such that the - * substring is at least half the length of longtext? - * @param longtext Longer string. - * @param shorttext Shorter string. - * @param i Start index of quarter length substring within longtext. - * @return Five element String array, containing the prefix of longtext, the - * suffix of longtext, the prefix of shorttext, the suffix of shorttext - * and the common middle. Or null if there was no match. - */ - private String[] diff_halfMatchI(String longtext, String shorttext, int i) { - // Start with a 1/4 length substring at position i as a seed. - String seed = longtext.substring(i, i + longtext.length() / 4); - int j = -1; - String best_common = ""; - String best_longtext_a = "", best_longtext_b = ""; - String best_shorttext_a = "", best_shorttext_b = ""; - while ((j = shorttext.indexOf(seed, j + 1)) != -1) { - int prefixLength = diff_commonPrefix(longtext.substring(i), - shorttext.substring(j)); - int suffixLength = diff_commonSuffix(longtext.substring(0, i), - shorttext.substring(0, j)); - if (best_common.length() < suffixLength + prefixLength) { - best_common = shorttext.substring(j - suffixLength, j) - + shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length() >= longtext.length() / 2) { - return new String[]{best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common}; - } else { - return null; - } - } - - - /** - * Reduce the number of edits by eliminating semantically trivial equalities. - * @param diffs LinkedList of Diff objects. - */ - public void diff_cleanupSemantic(LinkedList<Diff> diffs) { - if (diffs.isEmpty()) { - return; - } - boolean changes = false; - Stack<Diff> equalities = new Stack<Diff>(); // Stack of qualities. - String lastequality = null; // Always equal to equalities.lastElement().text - ListIterator<Diff> pointer = diffs.listIterator(); - // Number of characters that changed prior to the equality. - int length_changes1 = 0; - // Number of characters that changed after the equality. - int length_changes2 = 0; - Diff thisDiff = pointer.next(); - while (thisDiff != null) { - if (thisDiff.operation == Operation.EQUAL) { - // equality found - equalities.push(thisDiff); - length_changes1 = length_changes2; - length_changes2 = 0; - lastequality = thisDiff.text; - } else { - // an insertion or deletion - length_changes2 += thisDiff.text.length(); - if (lastequality != null && (lastequality.length() <= length_changes1) - && (lastequality.length() <= length_changes2)) { - //System.out.println("Splitting: '" + lastequality + "'"); - // Walk back to offending equality. - while (thisDiff != equalities.lastElement()) { - thisDiff = pointer.previous(); - } - pointer.next(); - - // Replace equality with a delete. - pointer.set(new Diff(Operation.DELETE, lastequality)); - // Insert a corresponding an insert. - pointer.add(new Diff(Operation.INSERT, lastequality)); - - equalities.pop(); // Throw away the equality we just deleted. - if (!equalities.empty()) { - // Throw away the previous equality (it needs to be reevaluated). - equalities.pop(); - } - if (equalities.empty()) { - // There are no previous equalities, walk back to the start. - while (pointer.hasPrevious()) { - pointer.previous(); - } - } else { - // There is a safe equality we can fall back to. - thisDiff = equalities.lastElement(); - while (thisDiff != pointer.previous()) { - // Intentionally empty loop. - } - } - - length_changes1 = 0; // Reset the counters. - length_changes2 = 0; - lastequality = null; - changes = true; - } - } - thisDiff = pointer.hasNext() ? pointer.next() : null; - } - - if (changes) { - diff_cleanupMerge(diffs); - } - diff_cleanupSemanticLossless(diffs); - } - - - /** - * Look for single edits surrounded on both sides by equalities - * which can be shifted sideways to align the edit to a word boundary. - * e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came. - * @param diffs LinkedList of Diff objects. - */ - public void diff_cleanupSemanticLossless(LinkedList<Diff> diffs) { - String equality1, edit, equality2; - String commonString; - int commonOffset; - int score, bestScore; - String bestEquality1, bestEdit, bestEquality2; - // Create a new iterator at the start. - ListIterator<Diff> pointer = diffs.listIterator(); - Diff prevDiff = pointer.hasNext() ? pointer.next() : null; - Diff thisDiff = pointer.hasNext() ? pointer.next() : null; - Diff nextDiff = pointer.hasNext() ? pointer.next() : null; - // Intentionally ignore the first and last element (don't need checking). - while (nextDiff != null) { - if (prevDiff.operation == Operation.EQUAL && - nextDiff.operation == Operation.EQUAL) { - // This is a single edit surrounded by equalities. - equality1 = prevDiff.text; - edit = thisDiff.text; - equality2 = nextDiff.text; - - // First, shift the edit as far left as possible. - commonOffset = diff_commonSuffix(equality1, edit); - if (commonOffset != 0) { - commonString = edit.substring(edit.length() - commonOffset); - equality1 = equality1.substring(0, equality1.length() - commonOffset); - edit = commonString + edit.substring(0, edit.length() - commonOffset); - equality2 = commonString + equality2; - } - - // Second, step character by character right, looking for the best fit. - bestEquality1 = equality1; - bestEdit = edit; - bestEquality2 = equality2; - bestScore = diff_cleanupSemanticScore(equality1, edit) - + diff_cleanupSemanticScore(edit, equality2); - while (edit.length() != 0 && equality2.length() != 0 - && edit.charAt(0) == equality2.charAt(0)) { - equality1 += edit.charAt(0); - edit = edit.substring(1) + equality2.charAt(0); - equality2 = equality2.substring(1); - score = diff_cleanupSemanticScore(equality1, edit) - + diff_cleanupSemanticScore(edit, equality2); - // The >= encourages trailing rather than leading whitespace on edits. - if (score >= bestScore) { - bestScore = score; - bestEquality1 = equality1; - bestEdit = edit; - bestEquality2 = equality2; - } - } - - if (!prevDiff.text.equals(bestEquality1)) { - // We have an improvement, save it back to the diff. - if (bestEquality1.length() != 0) { - prevDiff.text = bestEquality1; - } else { - pointer.previous(); // Walk past nextDiff. - pointer.previous(); // Walk past thisDiff. - pointer.previous(); // Walk past prevDiff. - pointer.remove(); // Delete prevDiff. - pointer.next(); // Walk past thisDiff. - pointer.next(); // Walk past nextDiff. - } - thisDiff.text = bestEdit; - if (bestEquality2.length() != 0) { - nextDiff.text = bestEquality2; - } else { - pointer.remove(); // Delete nextDiff. - nextDiff = thisDiff; - thisDiff = prevDiff; - } - } - } - prevDiff = thisDiff; - thisDiff = nextDiff; - nextDiff = pointer.hasNext() ? pointer.next() : null; - } - } - - - /** - * Given two strings, compute a score representing whether the internal - * boundary falls on logical boundaries. - * Scores range from 5 (best) to 0 (worst). - * @param one First string. - * @param two Second string. - * @return The score. - */ - private int diff_cleanupSemanticScore(String one, String two) { - if (one.length() == 0 || two.length() == 0) { - // Edges are the best. - return 5; - } - - // Each port of this function behaves slightly differently due to - // subtle differences in each language's definition of things like - // 'whitespace'. Since this function's purpose is largely cosmetic, - // the choice has been made to use each language's native features - // rather than force total conformity. - int score = 0; - // One point for non-alphanumeric. - if (!Character.isLetterOrDigit(one.charAt(one.length() - 1)) - || !Character.isLetterOrDigit(two.charAt(0))) { - score++; - // Two points for whitespace. - if (Character.isWhitespace(one.charAt(one.length() - 1)) - || Character.isWhitespace(two.charAt(0))) { - score++; - // Three points for line breaks. - if (Character.getType(one.charAt(one.length() - 1)) == Character.CONTROL - || Character.getType(two.charAt(0)) == Character.CONTROL) { - score++; - // Four points for blank lines. - if (BLANKLINEEND.matcher(one).find() - || BLANKLINESTART.matcher(two).find()) { - score++; - } - } - } - } - return score; - } - - - private Pattern BLANKLINEEND - = Pattern.compile("\\n\\r?\\n\\Z", Pattern.DOTALL); - private Pattern BLANKLINESTART - = Pattern.compile("\\A\\r?\\n\\r?\\n", Pattern.DOTALL); - - - /** - * Reduce the number of edits by eliminating operationally trivial equalities. - * @param diffs LinkedList of Diff objects. - */ - public void diff_cleanupEfficiency(LinkedList<Diff> diffs) { - if (diffs.isEmpty()) { - return; - } - boolean changes = false; - Stack<Diff> equalities = new Stack<Diff>(); // Stack of equalities. - String lastequality = null; // Always equal to equalities.lastElement().text - ListIterator<Diff> pointer = diffs.listIterator(); - // Is there an insertion operation before the last equality. - boolean pre_ins = false; - // Is there a deletion operation before the last equality. - boolean pre_del = false; - // Is there an insertion operation after the last equality. - boolean post_ins = false; - // Is there a deletion operation after the last equality. - boolean post_del = false; - Diff thisDiff = pointer.next(); - Diff safeDiff = thisDiff; // The last Diff that is known to be unsplitable. - while (thisDiff != null) { - if (thisDiff.operation == Operation.EQUAL) { - // equality found - if (thisDiff.text.length() < Diff_EditCost && (post_ins || post_del)) { - // Candidate found. - equalities.push(thisDiff); - pre_ins = post_ins; - pre_del = post_del; - lastequality = thisDiff.text; - } else { - // Not a candidate, and can never become one. - equalities.clear(); - lastequality = null; - safeDiff = thisDiff; - } - post_ins = post_del = false; - } else { - // an insertion or deletion - if (thisDiff.operation == Operation.DELETE) { - post_del = true; - } else { - post_ins = true; - } - /* - * Five types to be split: - * <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del> - * <ins>A</ins>X<ins>C</ins><del>D</del> - * <ins>A</ins><del>B</del>X<ins>C</ins> - * <ins>A</del>X<ins>C</ins><del>D</del> - * <ins>A</ins><del>B</del>X<del>C</del> - */ - if (lastequality != null - && ((pre_ins && pre_del && post_ins && post_del) - || ((lastequality.length() < Diff_EditCost / 2) - && ((pre_ins ? 1 : 0) + (pre_del ? 1 : 0) - + (post_ins ? 1 : 0) + (post_del ? 1 : 0)) == 3))) { - //System.out.println("Splitting: '" + lastequality + "'"); - // Walk back to offending equality. - while (thisDiff != equalities.lastElement()) { - thisDiff = pointer.previous(); - } - pointer.next(); - - // Replace equality with a delete. - pointer.set(new Diff(Operation.DELETE, lastequality)); - // Insert a corresponding an insert. - pointer.add(thisDiff = new Diff(Operation.INSERT, lastequality)); - - equalities.pop(); // Throw away the equality we just deleted. - lastequality = null; - if (pre_ins && pre_del) { - // No changes made which could affect previous entry, keep going. - post_ins = post_del = true; - equalities.clear(); - safeDiff = thisDiff; - } else { - if (!equalities.empty()) { - // Throw away the previous equality (it needs to be reevaluated). - equalities.pop(); - } - if (equalities.empty()) { - // There are no previous questionable equalities, - // walk back to the last known safe diff. - thisDiff = safeDiff; - } else { - // There is an equality we can fall back to. - thisDiff = equalities.lastElement(); - } - while (thisDiff != pointer.previous()) { - // Intentionally empty loop. - } - post_ins = post_del = false; - } - - changes = true; - } - } - thisDiff = pointer.hasNext() ? pointer.next() : null; - } - - if (changes) { - diff_cleanupMerge(diffs); - } - } - - - /** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param diffs LinkedList of Diff objects. - */ - public void diff_cleanupMerge(LinkedList<Diff> diffs) { - diffs.add(new Diff(Operation.EQUAL, "")); // Add a dummy entry at the end. - ListIterator<Diff> pointer = diffs.listIterator(); - int count_delete = 0; - int count_insert = 0; - String text_delete = ""; - String text_insert = ""; - Diff thisDiff = pointer.next(); - Diff prevEqual = null; - int commonlength; - while (thisDiff != null) { - switch (thisDiff.operation) { - case INSERT: - count_insert++; - text_insert += thisDiff.text; - prevEqual = null; - break; - case DELETE: - count_delete++; - text_delete += thisDiff.text; - prevEqual = null; - break; - case EQUAL: - if (count_delete != 0 || count_insert != 0) { - // Delete the offending records. - pointer.previous(); // Reverse direction. - while (count_delete-- > 0) { - pointer.previous(); - pointer.remove(); - } - while (count_insert-- > 0) { - pointer.previous(); - pointer.remove(); - } - if (count_delete != 0 && count_insert != 0) { - // Factor out any common prefixies. - commonlength = diff_commonPrefix(text_insert, text_delete); - if (commonlength != 0) { - if (pointer.hasPrevious()) { - thisDiff = pointer.previous(); - assert thisDiff.operation == Operation.EQUAL - : "Previous diff should have been an equality."; - thisDiff.text += text_insert.substring(0, commonlength); - pointer.next(); - } else { - pointer.add(new Diff(Operation.EQUAL, - text_insert.substring(0, commonlength))); - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixies. - commonlength = diff_commonSuffix(text_insert, text_delete); - if (commonlength != 0) { - thisDiff = pointer.next(); - thisDiff.text = text_insert.substring(text_insert.length() - - commonlength) + thisDiff.text; - text_insert = text_insert.substring(0, text_insert.length() - - commonlength); - text_delete = text_delete.substring(0, text_delete.length() - - commonlength); - pointer.previous(); - } - } - // Insert the merged records. - if (text_delete.length() != 0) { - pointer.add(new Diff(Operation.DELETE, text_delete)); - } - if (text_insert.length() != 0) { - pointer.add(new Diff(Operation.INSERT, text_insert)); - } - // Step forward to the equality. - thisDiff = pointer.hasNext() ? pointer.next() : null; - } else if (prevEqual != null) { - // Merge this equality with the previous one. - prevEqual.text += thisDiff.text; - pointer.remove(); - thisDiff = pointer.previous(); - pointer.next(); // Forward direction - } - count_insert = 0; - count_delete = 0; - text_delete = ""; - text_insert = ""; - prevEqual = thisDiff; - break; - } - thisDiff = pointer.hasNext() ? pointer.next() : null; - } - // System.out.println(diff); - if (diffs.getLast().text.length() == 0) { - diffs.removeLast(); // Remove the dummy entry at the end. - } - - /* - * Second pass: look for single edits surrounded on both sides by equalities - * which can be shifted sideways to eliminate an equality. - * e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC - */ - boolean changes = false; - // Create a new iterator at the start. - // (As opposed to walking the current one back.) - pointer = diffs.listIterator(); - Diff prevDiff = pointer.hasNext() ? pointer.next() : null; - thisDiff = pointer.hasNext() ? pointer.next() : null; - Diff nextDiff = pointer.hasNext() ? pointer.next() : null; - // Intentionally ignore the first and last element (don't need checking). - while (nextDiff != null) { - if (prevDiff.operation == Operation.EQUAL && - nextDiff.operation == Operation.EQUAL) { - // This is a single edit surrounded by equalities. - if (thisDiff.text.endsWith(prevDiff.text)) { - // Shift the edit over the previous equality. - thisDiff.text = prevDiff.text - + thisDiff.text.substring(0, thisDiff.text.length() - - prevDiff.text.length()); - nextDiff.text = prevDiff.text + nextDiff.text; - pointer.previous(); // Walk past nextDiff. - pointer.previous(); // Walk past thisDiff. - pointer.previous(); // Walk past prevDiff. - pointer.remove(); // Delete prevDiff. - pointer.next(); // Walk past thisDiff. - thisDiff = pointer.next(); // Walk past nextDiff. - nextDiff = pointer.hasNext() ? pointer.next() : null; - changes = true; - } else if (thisDiff.text.startsWith(nextDiff.text)) { - // Shift the edit over the next equality. - prevDiff.text += nextDiff.text; - thisDiff.text = thisDiff.text.substring(nextDiff.text.length()) - + nextDiff.text; - pointer.remove(); // Delete nextDiff. - nextDiff = pointer.hasNext() ? pointer.next() : null; - changes = true; - } - } - prevDiff = thisDiff; - thisDiff = nextDiff; - nextDiff = pointer.hasNext() ? pointer.next() : null; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - diff_cleanupMerge(diffs); - } - } - - - /** - * loc is a location in text1, compute and return the equivalent location in - * text2. - * e.g. "The cat" vs "The big cat", 1->1, 5->8 - * @param diffs LinkedList of Diff objects. - * @param loc Location within text1. - * @return Location within text2. - */ - public int diff_xIndex(LinkedList<Diff> diffs, int loc) { - int chars1 = 0; - int chars2 = 0; - int last_chars1 = 0; - int last_chars2 = 0; - Diff lastDiff = null; - for (Diff aDiff : diffs) { - if (aDiff.operation != Operation.INSERT) { - // Equality or deletion. - chars1 += aDiff.text.length(); - } - if (aDiff.operation != Operation.DELETE) { - // Equality or insertion. - chars2 += aDiff.text.length(); - } - if (chars1 > loc) { - // Overshot the location. - lastDiff = aDiff; - break; - } - last_chars1 = chars1; - last_chars2 = chars2; - } - if (lastDiff != null && lastDiff.operation == Operation.DELETE) { - // The location was deleted. - return last_chars2; - } - // Add the remaining character length. - return last_chars2 + (loc - last_chars1); - } - - - /** - * Convert a Diff list into a pretty HTML report. - * @param diffs LinkedList of Diff objects. - * @return HTML representation. - */ - public String diff_prettyHtml(LinkedList<Diff> diffs) { - StringBuilder html = new StringBuilder(); - int i = 0; - for (Diff aDiff : diffs) { - String text = aDiff.text.replace("&", "&").replace("<", "<") - .replace(">", ">").replace("\n", "¶<BR>"); - switch (aDiff.operation) { - case INSERT: - html.append("<INS STYLE=\"background:#E6FFE6;\" TITLE=\"i=").append(i) - .append("\">").append(text).append("</INS>"); - break; - case DELETE: - html.append("<DEL STYLE=\"background:#FFE6E6;\" TITLE=\"i=").append(i) - .append("\">").append(text).append("</DEL>"); - break; - case EQUAL: - html.append("<SPAN TITLE=\"i=").append(i).append("\">").append(text) - .append("</SPAN>"); - break; - } - if (aDiff.operation != Operation.DELETE) { - i += aDiff.text.length(); - } - } - return html.toString(); - } - - - /** - * Compute and return the source text (all equalities and deletions). - * @param diffs LinkedList of Diff objects. - * @return Source text. - */ - public String diff_text1(LinkedList<Diff> diffs) { - StringBuilder text = new StringBuilder(); - for (Diff aDiff : diffs) { - if (aDiff.operation != Operation.INSERT) { - text.append(aDiff.text); - } - } - return text.toString(); - } - - - /** - * Compute and return the destination text (all equalities and insertions). - * @param diffs LinkedList of Diff objects. - * @return Destination text. - */ - public String diff_text2(LinkedList<Diff> diffs) { - StringBuilder text = new StringBuilder(); - for (Diff aDiff : diffs) { - if (aDiff.operation != Operation.DELETE) { - text.append(aDiff.text); - } - } - return text.toString(); - } - - - /** - * Compute the Levenshtein distance; the number of inserted, deleted or - * substituted characters. - * @param diffs LinkedList of Diff objects. - * @return Number of changes. - */ - public int diff_levenshtein(LinkedList<Diff> diffs) { - int levenshtein = 0; - int insertions = 0; - int deletions = 0; - for (Diff aDiff : diffs) { - switch (aDiff.operation) { - case INSERT: - insertions += aDiff.text.length(); - break; - case DELETE: - deletions += aDiff.text.length(); - break; - case EQUAL: - // A deletion and an insertion is one substitution. - levenshtein += Math.max(insertions, deletions); - insertions = 0; - deletions = 0; - break; - } - } - levenshtein += Math.max(insertions, deletions); - return levenshtein; - } - - - /** - * Crush the diff into an encoded string which describes the operations - * required to transform text1 into text2. - * E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'. - * Operations are tab-separated. Inserted text is escaped using %xx notation. - * @param diffs Array of diff tuples. - * @return Delta text. - */ - public String diff_toDelta(LinkedList<Diff> diffs) { - StringBuilder text = new StringBuilder(); - for (Diff aDiff : diffs) { - switch (aDiff.operation) { - case INSERT: - try { - text.append("+").append(URLEncoder.encode(aDiff.text, "UTF-8") - .replace('+', ' ')).append("\t"); - } catch (UnsupportedEncodingException e) { - // Not likely on modern system. - throw new Error("This system does not support UTF-8.", e); - } - break; - case DELETE: - text.append("-").append(aDiff.text.length()).append("\t"); - break; - case EQUAL: - text.append("=").append(aDiff.text.length()).append("\t"); - break; - } - } - String delta = text.toString(); - if (delta.length() != 0) { - // Strip off trailing tab character. - delta = delta.substring(0, delta.length() - 1); - delta = unescapeForEncodeUriCompatability(delta); - } - return delta; - } - - - /** - * Given the original text1, and an encoded string which describes the - * operations required to transform text1 into text2, compute the full diff. - * @param text1 Source string for the diff. - * @param delta Delta text. - * @return Array of diff tuples or null if invalid. - * @throws IllegalArgumentException If invalid input. - */ - public LinkedList<Diff> diff_fromDelta(String text1, String delta) - throws IllegalArgumentException { - LinkedList<Diff> diffs = new LinkedList<Diff>(); - int pointer = 0; // Cursor in text1 - String[] tokens = delta.split("\t"); - for (String token : tokens) { - if (token.length() == 0) { - // Blank tokens are ok (from a trailing \t). - continue; - } - // Each token begins with a one character parameter which specifies the - // operation of this token (delete, insert, equality). - String param = token.substring(1); - switch (token.charAt(0)) { - case '+': - // decode would change all "+" to " " - param = param.replace("+", "%2B"); - try { - param = URLDecoder.decode(param, "UTF-8"); - } catch (UnsupportedEncodingException e) { - // Not likely on modern system. - throw new Error("This system does not support UTF-8.", e); - } catch (IllegalArgumentException e) { - // Malformed URI sequence. - throw new IllegalArgumentException( - "Illegal escape in diff_fromDelta: " + param, e); - } - diffs.add(new Diff(Operation.INSERT, param)); - break; - case '-': - // Fall through. - case '=': - int n; - try { - n = Integer.parseInt(param); - } catch (NumberFormatException e) { - throw new IllegalArgumentException( - "Invalid number in diff_fromDelta: " + param, e); - } - if (n < 0) { - throw new IllegalArgumentException( - "Negative number in diff_fromDelta: " + param); - } - String text; - try { - text = text1.substring(pointer, pointer += n); - } catch (StringIndexOutOfBoundsException e) { - throw new IllegalArgumentException("Delta length (" + pointer - + ") larger than source text length (" + text1.length() - + ").", e); - } - if (token.charAt(0) == '=') { - diffs.add(new Diff(Operation.EQUAL, text)); - } else { - diffs.add(new Diff(Operation.DELETE, text)); - } - break; - default: - // Anything else is an error. - throw new IllegalArgumentException( - "Invalid diff operation in diff_fromDelta: " + token.charAt(0)); - } - } - if (pointer != text1.length()) { - throw new IllegalArgumentException("Delta length (" + pointer - + ") smaller than source text length (" + text1.length() + ")."); - } - return diffs; - } - - - // MATCH FUNCTIONS - - - /** - * Locate the best instance of 'pattern' in 'text' near 'loc'. - * Returns -1 if no match found. - * @param text The text to search. - * @param pattern The pattern to search for. - * @param loc The location to search around. - * @return Best match index or -1. - */ - public int match_main(String text, String pattern, int loc) { - loc = Math.max(0, Math.min(loc, text.length())); - if (text.equals(pattern)) { - // Shortcut (potentially not guaranteed by the algorithm) - return 0; - } else if (text.length() == 0) { - // Nothing to match. - return -1; - } else if (loc + pattern.length() <= text.length() - && text.substring(loc, loc + pattern.length()).equals(pattern)) { - // Perfect match at the perfect spot! (Includes case of null pattern) - return loc; - } else { - // Do a fuzzy compare. - return match_bitap(text, pattern, loc); - } - } - - - /** - * Locate the best instance of 'pattern' in 'text' near 'loc' using the - * Bitap algorithm. Returns -1 if no match found. - * @param text The text to search. - * @param pattern The pattern to search for. - * @param loc The location to search around. - * @return Best match index or -1. - */ - protected int match_bitap(String text, String pattern, int loc) { - assert (Match_MaxBits == 0 || pattern.length() <= Match_MaxBits) - : "Pattern too long for this application."; - - // Initialise the alphabet. - Map<Character, Integer> s = match_alphabet(pattern); - - // Highest score beyond which we give up. - double score_threshold = Match_Threshold; - // Is there a nearby exact match? (speedup) - int best_loc = text.indexOf(pattern, loc); - if (best_loc != -1) { - score_threshold = Math.min(match_bitapScore(0, best_loc, loc, pattern), - score_threshold); - // What about in the other direction? (speedup) - best_loc = text.lastIndexOf(pattern, loc + pattern.length()); - if (best_loc != -1) { - score_threshold = Math.min(match_bitapScore(0, best_loc, loc, pattern), - score_threshold); - } - } - - // Initialise the bit arrays. - int matchmask = 1 << (pattern.length() - 1); - best_loc = -1; - - int bin_min, bin_mid; - int bin_max = pattern.length() + text.length(); - // Empty initialization added to appease Java compiler. - int[] last_rd = new int[0]; - for (int d = 0; d < pattern.length(); d++) { - // Scan for the best match; each iteration allows for one more error. - // Run a binary search to determine how far from 'loc' we can stray at - // this error level. - bin_min = 0; - bin_mid = bin_max; - while (bin_min < bin_mid) { - if (match_bitapScore(d, loc + bin_mid, loc, pattern) - <= score_threshold) { - bin_min = bin_mid; - } else { - bin_max = bin_mid; - } - bin_mid = (bin_max - bin_min) / 2 + bin_min; - } - // Use the result from this iteration as the maximum for the next. - bin_max = bin_mid; - int start = Math.max(1, loc - bin_mid + 1); - int finish = Math.min(loc + bin_mid, text.length()) + pattern.length(); - - int[] rd = new int[finish + 2]; - rd[finish + 1] = (1 << d) - 1; - for (int j = finish; j >= start; j--) { - int charMatch; - if (text.length() <= j - 1 || !s.containsKey(text.charAt(j - 1))) { - // Out of range. - charMatch = 0; - } else { - charMatch = s.get(text.charAt(j - 1)); - } - if (d == 0) { - // First pass: exact match. - rd[j] = ((rd[j + 1] << 1) | 1) & charMatch; - } else { - // Subsequent passes: fuzzy match. - rd[j] = ((rd[j + 1] << 1) | 1) & charMatch - | (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | last_rd[j + 1]; - } - if ((rd[j] & matchmask) != 0) { - double score = match_bitapScore(d, j - 1, loc, pattern); - // This match will almost certainly be better than any existing - // match. But check anyway. - if (score <= score_threshold) { - // Told you so. - score_threshold = score; - best_loc = j - 1; - if (best_loc > loc) { - // When passing loc, don't exceed our current distance from loc. - start = Math.max(1, 2 * loc - best_loc); - } else { - // Already passed loc, downhill from here on in. - break; - } - } - } - } - if (match_bitapScore(d + 1, loc, loc, pattern) > score_threshold) { - // No hope for a (better) match at greater error levels. - break; - } - last_rd = rd; - } - return best_loc; - } - - - /** - * Compute and return the score for a match with e errors and x location. - * @param e Number of errors in match. - * @param x Location of match. - * @param loc Expected location of match. - * @param pattern Pattern being sought. - * @return Overall score for match (0.0 = good, 1.0 = bad). - */ - private double match_bitapScore(int e, int x, int loc, String pattern) { - float accuracy = (float) e / pattern.length(); - int proximity = Math.abs(loc - x); - if (Match_Distance == 0) { - // Dodge divide by zero error. - return proximity == 0 ? accuracy : 1.0; - } - return accuracy + (proximity / (float) Match_Distance); - } - - - /** - * Initialise the alphabet for the Bitap algorithm. - * @param pattern The text to encode. - * @return Hash of character locations. - */ - protected Map<Character, Integer> match_alphabet(String pattern) { - Map<Character, Integer> s = new HashMap<Character, Integer>(); - char[] char_pattern = pattern.toCharArray(); - for (char c : char_pattern) { - s.put(c, 0); - } - int i = 0; - for (char c : char_pattern) { - s.put(c, s.get(c) | (1 << (pattern.length() - i - 1))); - i++; - } - return s; - } - - - // PATCH FUNCTIONS - - - /** - * Increase the context until it is unique, - * but don't let the pattern expand beyond Match_MaxBits. - * @param patch The patch to grow. - * @param text Source text. - */ - protected void patch_addContext(Patch patch, String text) { - if (text.length() == 0) { - return; - } - String pattern = text.substring(patch.start2, patch.start2 + patch.length1); - int padding = 0; - - // Look for the first and last matches of pattern in text. If two different - // matches are found, increase the pattern length. - while (text.indexOf(pattern) != text.lastIndexOf(pattern) - && pattern.length() < Match_MaxBits - Patch_Margin - Patch_Margin) { - padding += Patch_Margin; - pattern = text.substring(Math.max(0, patch.start2 - padding), - Math.min(text.length(), patch.start2 + patch.length1 + padding)); - } - // Add one chunk for good luck. - padding += Patch_Margin; - - // Add the prefix. - String prefix = text.substring(Math.max(0, patch.start2 - padding), - patch.start2); - if (prefix.length() != 0) { - patch.diffs.addFirst(new Diff(Operation.EQUAL, prefix)); - } - // Add the suffix. - String suffix = text.substring(patch.start2 + patch.length1, - Math.min(text.length(), patch.start2 + patch.length1 + padding)); - if (suffix.length() != 0) { - patch.diffs.addLast(new Diff(Operation.EQUAL, suffix)); - } - - // Roll back the start points. - patch.start1 -= prefix.length(); - patch.start2 -= prefix.length(); - // Extend the lengths. - patch.length1 += prefix.length() + suffix.length(); - patch.length2 += prefix.length() + suffix.length(); - } - - - /** - * Compute a list of patches to turn text1 into text2. - * A set of diffs will be computed. - * @param text1 Old text. - * @param text2 New text. - * @return LinkedList of Patch objects. - */ - public LinkedList<Patch> patch_make(String text1, String text2) { - // No diffs provided, compute our own. - LinkedList<Diff> diffs = diff_main(text1, text2, true); - if (diffs.size() > 2) { - diff_cleanupSemantic(diffs); - diff_cleanupEfficiency(diffs); - } - return patch_make(text1, diffs); - } - - - /** - * Compute a list of patches to turn text1 into text2. - * text1 will be derived from the provided diffs. - * @param diffs Array of diff tuples for text1 to text2. - * @return LinkedList of Patch objects. - */ - public LinkedList<Patch> patch_make(LinkedList<Diff> diffs) { - // No origin string provided, compute our own. - String text1 = diff_text1(diffs); - return patch_make(text1, diffs); - } - - - /** - * Compute a list of patches to turn text1 into text2. - * text2 is ignored, diffs are the delta between text1 and text2. - * @param text1 Old text - * @param text2 Ignored. - * @param diffs Array of diff tuples for text1 to text2. - * @return LinkedList of Patch objects. - * @deprecated Prefer patch_make(String text1, LinkedList<Diff> diffs). - */ - public LinkedList<Patch> patch_make(String text1, String text2, - LinkedList<Diff> diffs) { - return patch_make(text1, diffs); - } - - - /** - * Compute a list of patches to turn text1 into text2. - * A set of diffs will be computed. - * @param text1 Old text. - * @param text2 New text. - * @return String representation of a LinkedList of Patch objects. - */ - public String custom_patch_make(String text1, String text2) { - return patch_toText(patch_make(text1, text2)); - } - - - /** - * Compute a list of patches to turn text1 into text2. - * text2 is not provided, diffs are the delta between text1 and text2. - * @param text1 Old text. - * @param diffs Array of diff tuples for text1 to text2. - * @return LinkedList of Patch objects. - */ - public LinkedList<Patch> patch_make(String text1, LinkedList<Diff> diffs) { - LinkedList<Patch> patches = new LinkedList<Patch>(); - if (diffs.isEmpty()) { - return patches; // Get rid of the null case. - } - Patch patch = new Patch(); - int char_count1 = 0; // Number of characters into the text1 string. - int char_count2 = 0; // Number of characters into the text2 string. - // Start with text1 (prepatch_text) and apply the diffs until we arrive at - // text2 (postpatch_text). We recreate the patches one by one to determine - // context info. - String prepatch_text = text1; - String postpatch_text = text1; - for (Diff aDiff : diffs) { - if (patch.diffs.isEmpty() && aDiff.operation != Operation.EQUAL) { - // A new patch starts here. - patch.start1 = char_count1; - patch.start2 = char_count2; - } - - switch (aDiff.operation) { - case INSERT: - patch.diffs.add(aDiff); - patch.length2 += aDiff.text.length(); - postpatch_text = postpatch_text.substring(0, char_count2) - + aDiff.text + postpatch_text.substring(char_count2); - break; - case DELETE: - patch.length1 += aDiff.text.length(); - patch.diffs.add(aDiff); - postpatch_text = postpatch_text.substring(0, char_count2) - + postpatch_text.substring(char_count2 + aDiff.text.length()); - break; - case EQUAL: - if (aDiff.text.length() <= 2 * Patch_Margin - && !patch.diffs.isEmpty() && aDiff != diffs.getLast()) { - // Small equality inside a patch. - patch.diffs.add(aDiff); - patch.length1 += aDiff.text.length(); - patch.length2 += aDiff.text.length(); - } - - if (aDiff.text.length() >= 2 * Patch_Margin) { - // Time for a new patch. - if (!patch.diffs.isEmpty()) { - patch_addContext(patch, prepatch_text); - patches.add(patch); - patch = new Patch(); - // Unlike Unidiff, our patch lists have a rolling context. - // http://code.google.com/p/google-diff-match-patch/wiki/Unidiff - // Update prepatch text & pos to reflect the application of the - // just completed patch. - prepatch_text = postpatch_text; - char_count1 = char_count2; - } - } - break; - } - - // Update the current character count. - if (aDiff.operation != Operation.INSERT) { - char_count1 += aDiff.text.length(); - } - if (aDiff.operation != Operation.DELETE) { - char_count2 += aDiff.text.length(); - } - } - // Pick up the leftover patch if not empty. - if (!patch.diffs.isEmpty()) { - patch_addContext(patch, prepatch_text); - patches.add(patch); - } - - return patches; - } - - - /** - * Given an array of patches, return another array that is identical. - * @param patches Array of patch objects. - * @return Array of patch objects. - */ - public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches) { - LinkedList<Patch> patchesCopy = new LinkedList<Patch>(); - for (Patch aPatch : patches) { - Patch patchCopy = new Patch(); - for (Diff aDiff : aPatch.diffs) { - Diff diffCopy = new Diff(aDiff.operation, aDiff.text); - patchCopy.diffs.add(diffCopy); - } - patchCopy.start1 = aPatch.start1; - patchCopy.start2 = aPatch.start2; - patchCopy.length1 = aPatch.length1; - patchCopy.length2 = aPatch.length2; - patchesCopy.add(patchCopy); - } - return patchesCopy; - } - - - /** - * Merge a set of patches onto the text. Return a patched text, as well - * as an array of true/false values indicating which patches were applied. - * @param patches Array of patch objects - * @param text Old text. - * @return Two element Object array, containing the new text and an array of - * boolean values. - */ - public Object[] patch_apply(LinkedList<Patch> patches, String text) { - if (patches.isEmpty()) { - return new Object[]{text, new boolean[0]}; - } - - // Deep copy the patches so that no changes are made to originals. - patches = patch_deepCopy(patches); - - String nullPadding = patch_addPadding(patches); - text = nullPadding + text + nullPadding; - patch_splitMax(patches); - - int x = 0; - // delta keeps track of the offset between the expected and actual location - // of the previous patch. If there are patches expected at positions 10 and - // 20, but the first patch was found at 12, delta is 2 and the second patch - // has an effective expected position of 22. - int delta = 0; - boolean[] results = new boolean[patches.size()]; - for (Patch aPatch : patches) { - int expected_loc = aPatch.start2 + delta; - String text1 = diff_text1(aPatch.diffs); - int start_loc; - int end_loc = -1; - if (text1.length() > this.Match_MaxBits) { - // patch_splitMax will only provide an oversized pattern in the case of - // a monster delete. - start_loc = match_main(text, - text1.substring(0, this.Match_MaxBits), expected_loc); - if (start_loc != -1) { - end_loc = match_main(text, - text1.substring(text1.length() - this.Match_MaxBits), - expected_loc + text1.length() - this.Match_MaxBits); - if (end_loc == -1 || start_loc >= end_loc) { - // Can't find valid trailing context. Drop this patch. - start_loc = -1; - } - } - } else { - start_loc = match_main(text, text1, expected_loc); - } - if (start_loc == -1) { - // No match found. :( - results[x] = false; - // Subtract the delta for this failed patch from subsequent patches. - delta -= aPatch.length2 - aPatch.length1; - } else { - // Found a match. :) - results[x] = true; - delta = start_loc - expected_loc; - String text2; - if (end_loc == -1) { - text2 = text.substring(start_loc, - Math.min(start_loc + text1.length(), text.length())); - } else { - text2 = text.substring(start_loc, - Math.min(end_loc + this.Match_MaxBits, text.length())); - } - if (text1.equals(text2)) { - // Perfect match, just shove the replacement text in. - text = text.substring(0, start_loc) + diff_text2(aPatch.diffs) - + text.substring(start_loc + text1.length()); - } else { - // Imperfect match. Run a diff to get a framework of equivalent - // indices. - LinkedList<Diff> diffs = diff_main(text1, text2, false); - if (text1.length() > this.Match_MaxBits - && diff_levenshtein(diffs) / (float) text1.length() - > this.Patch_DeleteThreshold) { - // The end points match, but the content is unacceptably bad. - results[x] = false; - } else { - diff_cleanupSemanticLossless(diffs); - int index1 = 0; - for (Diff aDiff : aPatch.diffs) { - if (aDiff.operation != Operation.EQUAL) { - int index2 = diff_xIndex(diffs, index1); - if (aDiff.operation == Operation.INSERT) { - // Insertion - text = text.substring(0, start_loc + index2) + aDiff.text - + text.substring(start_loc + index2); - } else if (aDiff.operation == Operation.DELETE) { - // Deletion - text = text.substring(0, start_loc + index2) - + text.substring(start_loc + diff_xIndex(diffs, - index1 + aDiff.text.length())); - } - } - if (aDiff.operation != Operation.DELETE) { - index1 += aDiff.text.length(); - } - } - } - } - } - x++; - } - // Strip the padding off. - text = text.substring(nullPadding.length(), text.length() - - nullPadding.length()); - return new Object[]{text, results}; - } - - - /** - * Add some padding on text start and end so that edges can match something. - * Intended to be called only from within patch_apply. - * @param patches Array of patch objects. - * @return The padding string added to each side. - */ - public String patch_addPadding(LinkedList<Patch> patches) { - int paddingLength = this.Patch_Margin; - String nullPadding = ""; - for (int x = 1; x <= paddingLength; x++) { - nullPadding += String.valueOf((char) x); - } - - // Bump all the patches forward. - for (Patch aPatch : patches) { - aPatch.start1 += paddingLength; - aPatch.start2 += paddingLength; - } - - // Add some padding on start of first diff. - Patch patch = patches.getFirst(); - LinkedList<Diff> diffs = patch.diffs; - if (diffs.isEmpty() || diffs.getFirst().operation != Operation.EQUAL) { - // Add nullPadding equality. - diffs.addFirst(new Diff(Operation.EQUAL, nullPadding)); - patch.start1 -= paddingLength; // Should be 0. - patch.start2 -= paddingLength; // Should be 0. - patch.length1 += paddingLength; - patch.length2 += paddingLength; - } else if (paddingLength > diffs.getFirst().text.length()) { - // Grow first equality. - Diff firstDiff = diffs.getFirst(); - int extraLength = paddingLength - firstDiff.text.length(); - firstDiff.text = nullPadding.substring(firstDiff.text.length()) - + firstDiff.text; - patch.start1 -= extraLength; - patch.start2 -= extraLength; - patch.length1 += extraLength; - patch.length2 += extraLength; - } - - // Add some padding on end of last diff. - patch = patches.getLast(); - diffs = patch.diffs; - if (diffs.isEmpty() || diffs.getLast().operation != Operation.EQUAL) { - // Add nullPadding equality. - diffs.addLast(new Diff(Operation.EQUAL, nullPadding)); - patch.length1 += paddingLength; - patch.length2 += paddingLength; - } else if (paddingLength > diffs.getLast().text.length()) { - // Grow last equality. - Diff lastDiff = diffs.getLast(); - int extraLength = paddingLength - lastDiff.text.length(); - lastDiff.text += nullPadding.substring(0, extraLength); - patch.length1 += extraLength; - patch.length2 += extraLength; - } - - return nullPadding; - } - - - /** - * Look through the patches and break up any which are longer than the - * maximum limit of the match algorithm. - * @param patches LinkedList of Patch objects. - */ - public void patch_splitMax(LinkedList<Patch> patches) { - int patch_size; - String precontext, postcontext; - Patch patch; - int start1, start2; - boolean empty; - Operation diff_type; - String diff_text; - ListIterator<Patch> pointer = patches.listIterator(); - Patch bigpatch = pointer.hasNext() ? pointer.next() : null; - while (bigpatch != null) { - if (bigpatch.length1 <= Match_MaxBits) { - bigpatch = pointer.hasNext() ? pointer.next() : null; - continue; - } - // Remove the big old patch. - pointer.remove(); - patch_size = Match_MaxBits; - start1 = bigpatch.start1; - start2 = bigpatch.start2; - precontext = ""; - while (!bigpatch.diffs.isEmpty()) { - // Create one of several smaller patches. - patch = new Patch(); - empty = true; - patch.start1 = start1 - precontext.length(); - patch.start2 = start2 - precontext.length(); - if (precontext.length() != 0) { - patch.length1 = patch.length2 = precontext.length(); - patch.diffs.add(new Diff(Operation.EQUAL, precontext)); - } - while (!bigpatch.diffs.isEmpty() - && patch.length1 < patch_size - Patch_Margin) { - diff_type = bigpatch.diffs.getFirst().operation; - diff_text = bigpatch.diffs.getFirst().text; - if (diff_type == Operation.INSERT) { - // Insertions are harmless. - patch.length2 += diff_text.length(); - start2 += diff_text.length(); - patch.diffs.addLast(bigpatch.diffs.removeFirst()); - empty = false; - } else if (diff_type == Operation.DELETE && patch.diffs.size() == 1 - && patch.diffs.getFirst().operation == Operation.EQUAL - && diff_text.length() > 2 * patch_size) { - // This is a large deletion. Let it pass in one chunk. - patch.length1 += diff_text.length(); - start1 += diff_text.length(); - empty = false; - patch.diffs.add(new Diff(diff_type, diff_text)); - bigpatch.diffs.removeFirst(); - } else { - // Deletion or equality. Only take as much as we can stomach. - diff_text = diff_text.substring(0, Math.min(diff_text.length(), - patch_size - patch.length1 - Patch_Margin)); - patch.length1 += diff_text.length(); - start1 += diff_text.length(); - if (diff_type == Operation.EQUAL) { - patch.length2 += diff_text.length(); - start2 += diff_text.length(); - } else { - empty = false; - } - patch.diffs.add(new Diff(diff_type, diff_text)); - if (diff_text.equals(bigpatch.diffs.getFirst().text)) { - bigpatch.diffs.removeFirst(); - } else { - bigpatch.diffs.getFirst().text = bigpatch.diffs.getFirst().text - .substring(diff_text.length()); - } - } - } - // Compute the head context for the next patch. - precontext = diff_text2(patch.diffs); - precontext = precontext.substring(Math.max(0, precontext.length() - - Patch_Margin)); - // Append the end context for this patch. - if (diff_text1(bigpatch.diffs).length() > Patch_Margin) { - postcontext = diff_text1(bigpatch.diffs).substring(0, Patch_Margin); - } else { - postcontext = diff_text1(bigpatch.diffs); - } - if (postcontext.length() != 0) { - patch.length1 += postcontext.length(); - patch.length2 += postcontext.length(); - if (!patch.diffs.isEmpty() - && patch.diffs.getLast().operation == Operation.EQUAL) { - patch.diffs.getLast().text += postcontext; - } else { - patch.diffs.add(new Diff(Operation.EQUAL, postcontext)); - } - } - if (!empty) { - pointer.add(patch); - } - } - bigpatch = pointer.hasNext() ? pointer.next() : null; - } - } - - - /** - * Take a list of patches and return a textual representation. - * @param patches List of Patch objects. - * @return Text representation of patches. - */ - public String patch_toText(List<Patch> patches) { - StringBuilder text = new StringBuilder(); - for (Patch aPatch : patches) { - text.append(aPatch); - } - return text.toString(); - } - - - /** - * Parse a textual representation of patches and return a List of Patch - * objects. - * @param textline Text representation of patches. - * @return List of Patch objects. - * @throws IllegalArgumentException If invalid input. - */ - public LinkedList<Patch> patch_fromText(String textline) - throws IllegalArgumentException { - LinkedList<Patch> patches = new LinkedList<Patch>(); - if (textline.length() == 0) { - return patches; - } - List<String> textList = Arrays.asList(textline.split("\n")); - LinkedList<String> text = new LinkedList<String>(textList); - Patch patch; - Pattern patchHeader - = Pattern.compile("^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$"); - Matcher m; - char sign; - String line; - while (!text.isEmpty()) { - m = patchHeader.matcher(text.getFirst()); - if (!m.matches()) { - throw new IllegalArgumentException( - "Invalid patch string: " + text.getFirst()); - } - patch = new Patch(); - patches.add(patch); - patch.start1 = Integer.parseInt(m.group(1)); - if (m.group(2).length() == 0) { - patch.start1--; - patch.length1 = 1; - } else if (m.group(2).equals("0")) { - patch.length1 = 0; - } else { - patch.start1--; - patch.length1 = Integer.parseInt(m.group(2)); - } - - patch.start2 = Integer.parseInt(m.group(3)); - if (m.group(4).length() == 0) { - patch.start2--; - patch.length2 = 1; - } else if (m.group(4).equals("0")) { - patch.length2 = 0; - } else { - patch.start2--; - patch.length2 = Integer.parseInt(m.group(4)); - } - text.removeFirst(); - - while (!text.isEmpty()) { - try { - sign = text.getFirst().charAt(0); - } catch (IndexOutOfBoundsException e) { - // Blank line? Whatever. - text.removeFirst(); - continue; - } - line = text.getFirst().substring(1); - line = line.replace("+", "%2B"); // decode would change all "+" to " " - try { - line = URLDecoder.decode(line, "UTF-8"); - } catch (UnsupportedEncodingException e) { - // Not likely on modern system. - throw new Error("This system does not support UTF-8.", e); - } catch (IllegalArgumentException e) { - // Malformed URI sequence. - throw new IllegalArgumentException( - "Illegal escape in patch_fromText: " + line, e); - } - if (sign == '-') { - // Deletion. - patch.diffs.add(new Diff(Operation.DELETE, line)); - } else if (sign == '+') { - // Insertion. - patch.diffs.add(new Diff(Operation.INSERT, line)); - } else if (sign == ' ') { - // Minor equality. - patch.diffs.add(new Diff(Operation.EQUAL, line)); - } else if (sign == '@') { - // Start of next patch. - break; - } else { - // WTF? - throw new IllegalArgumentException( - "Invalid patch mode '" + sign + "' in: " + line); - } - text.removeFirst(); - } - } - return patches; - } - - - /** - * Class representing one diff operation. - */ - public static class Diff { - /** - * One of: INSERT, DELETE or EQUAL. - */ - public Operation operation; - /** - * The text associated with this diff operation. - */ - public String text; - - /** - * Constructor. Initializes the diff with the provided values. - * @param operation One of INSERT, DELETE or EQUAL. - * @param text The text being applied. - */ - public Diff(Operation operation, String text) { - // Construct a diff with the specified operation and text. - this.operation = operation; - this.text = text; - } - - - /** - * Display a human-readable version of this Diff. - * @return text version. - */ - public String toString() { - String prettyText = this.text.replace('\n', '\u00b6'); - return "Diff(" + this.operation + ",\"" + prettyText + "\")"; - } - - - /** - * Is this Diff equivalent to another Diff? - * @param d Another Diff to compare against. - * @return true or false. - */ - public boolean equals(Object d) { - try { - return (((Diff) d).operation == this.operation) - && (((Diff) d).text.equals(this.text)); - } catch (ClassCastException e) { - return false; - } - } - } - - - /** - * Class representing one patch operation. - */ - public static class Patch { - public LinkedList<Diff> diffs; - public int start1; - public int start2; - public int length1; - public int length2; - - - /** - * Constructor. Initializes with an empty list of diffs. - */ - public Patch() { - this.diffs = new LinkedList<Diff>(); - } - - - /** - * Emmulate GNU diff's format. - * Header: @@ -382,8 +481,9 @@ - * Indicies are printed as 1-based, not 0-based. - * @return The GNU diff string. - */ - public String toString() { - String coords1, coords2; - if (this.length1 == 0) { - coords1 = this.start1 + ",0"; - } else if (this.length1 == 1) { - coords1 = Integer.toString(this.start1 + 1); - } else { - coords1 = (this.start1 + 1) + "," + this.length1; - } - if (this.length2 == 0) { - coords2 = this.start2 + ",0"; - } else if (this.length2 == 1) { - coords2 = Integer.toString(this.start2 + 1); - } else { - coords2 = (this.start2 + 1) + "," + this.length2; - } - StringBuilder text = new StringBuilder(); - text.append("@@ -").append(coords1).append(" +").append(coords2) - .append(" @@\n"); - // Escape the body of the patch with %xx notation. - for (Diff aDiff : this.diffs) { - switch (aDiff.operation) { - case INSERT: - text.append('+'); - break; - case DELETE: - text.append('-'); - break; - case EQUAL: - text.append(' '); - break; - } - try { - text.append(URLEncoder.encode(aDiff.text, "UTF-8").replace('+', ' ')) - .append("\n"); - } catch (UnsupportedEncodingException e) { - // Not likely on modern system. - throw new Error("This system does not support UTF-8.", e); - } - } - return unescapeForEncodeUriCompatability(text.toString()); - } - } - - - /** - * Unescape selected chars for compatability with JavaScript's encodeURI. - * In speed critical applications this could be dropped since the - * receiving application will certainly decode these fine. - * Note that this function is case-sensitive. Thus "%3f" would not be - * unescaped. But this is ok because it is only called with the output of - * URLEncoder.encode which returns uppercase hex. - * - * Example: "%3F" -> "?", "%24" -> "$", etc. - * - * @param str The string to escape. - * @return The escaped string. - */ - private static String unescapeForEncodeUriCompatability(String str) { - return str.replace("%21", "!").replace("%7E", "~") - .replace("%27", "'").replace("%28", "(").replace("%29", ")") - .replace("%3B", ";").replace("%2F", "/").replace("%3F", "?") - .replace("%3A", ":").replace("%40", "@").replace("%26", "&") - .replace("%3D", "=").replace("%2B", "+").replace("%24", "$") - .replace("%2C", ",").replace("%23", "#"); - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala index 981b75c0fee5582b1f1c0e42826489e48685f284..3014c51d23090c0f0428bf34bf776c59032b6fa1 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala @@ -36,9 +36,6 @@ trait SystemConfiguration { lazy val toAkkaAppsJsonChannel = Try(config.getString("eventBus.toAkkaAppsChannel")).getOrElse("to-akka-apps-json-channel") lazy val fromAkkaAppsJsonChannel = Try(config.getString("eventBus.fromAkkaAppsChannel")).getOrElse("from-akka-apps-json-channel") - lazy val maxNumberOfNotes = Try(config.getInt("sharedNotes.maxNumberOfNotes")).getOrElse(3) - lazy val maxNumberOfUndos = Try(config.getInt("sharedNotes.maxNumberOfUndos")).getOrElse(30) - lazy val applyPermissionCheck = Try(config.getBoolean("apps.checkPermissions")).getOrElse(false) lazy val voiceConfRecordPath = Try(config.getString("voiceConf.recordPath")).getOrElse("/var/freeswitch/meetings") diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/SharedNotesModel.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/SharedNotesModel.scala deleted file mode 100755 index cb449550276f689853a3e28e333f0f3a77d3c9a0..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/SharedNotesModel.scala +++ /dev/null @@ -1,126 +0,0 @@ -package org.bigbluebutton.core.apps - -import name.fraser.neil.plaintext.diff_match_patch - -import scala.collection._ -import scala.collection.immutable.List -import scala.collection.mutable.HashMap - -import org.bigbluebutton.SystemConfiguration -import org.bigbluebutton.common2.msgs.Note -import org.bigbluebutton.common2.msgs.NoteReport -import org.bigbluebutton.core.models.SystemUser - -class SharedNotesModel extends SystemConfiguration { - val MAIN_NOTE_ID = "MAIN_NOTE" - val SYSTEM_ID = SystemUser.ID - - private val patcher = new diff_match_patch() - - private var notesCounter = 0; - private var removedNotes: Set[Int] = Set() - - val notes = new HashMap[String, Note]() - notes += (MAIN_NOTE_ID -> new Note("", "", 0, List[(String, String)](), List[(String, String)]())) - - def patchNote(noteId: String, patch: String, operation: String): (Integer, String, Boolean, Boolean) = { - val note = notes(noteId) - val document = note.document - var undoPatches = note.undoPatches - var redoPatches = note.redoPatches - - val patchToApply = operation match { - case "PATCH" => { - patch - } - case "UNDO" => { - if (undoPatches.isEmpty) { - return (-1, "", false, false) - } else { - val (undo, redo) = undoPatches.head - undoPatches = undoPatches.tail - redoPatches = (undo, redo) :: redoPatches - undo - } - } - case "REDO" => { - if (redoPatches.isEmpty) { - return (-1, "", false, false) - } else { - val (undo, redo) = redoPatches.head - redoPatches = redoPatches.tail - undoPatches = (undo, redo) :: undoPatches - redo - } - } - } - - val patchObjects = patcher.patch_fromText(patchToApply) - val result = patcher.patch_apply(patchObjects, document) - - // If it is a patch operation, save an undo patch and clear redo stack - if (operation == "PATCH") { - undoPatches = (patcher.custom_patch_make(result(0).toString(), document), patchToApply) :: undoPatches - redoPatches = List[(String, String)]() - - if (undoPatches.size > maxNumberOfUndos) { - undoPatches = undoPatches.dropRight(1) - } - } - - val patchCounter = note.patchCounter + 1 - notes(noteId) = new Note(note.name, result(0).toString(), patchCounter, undoPatches, redoPatches) - (patchCounter, patchToApply, !undoPatches.isEmpty, !redoPatches.isEmpty) - } - - def clearNote(noteId: String): Option[NoteReport] = { - val note = notes(noteId) - val patchCounter = note.patchCounter + 1 - notes(noteId) = new Note(note.name, "", patchCounter, List[(String, String)](), List[(String, String)]()) - getNoteReport(noteId) - } - - def createNote(noteName: String = ""): (String, Boolean) = { - var noteId = 0 - if (removedNotes.isEmpty) { - notesCounter += 1 - noteId = notesCounter - } else { - noteId = removedNotes.min - removedNotes -= noteId - } - notes += (noteId.toString -> new Note(noteName, "", 0, List[(String, String)](), List[(String, String)]())) - - (noteId.toString, isNotesLimit) - } - - def destroyNote(noteId: String): Boolean = { - removedNotes += noteId.toInt - notes -= noteId - isNotesLimit - } - - def notesReport: HashMap[String, NoteReport] = { - val report = new HashMap[String, NoteReport]() - notes foreach { - case (id, note) => - report += (id -> noteToReport(note)) - } - report - } - - def getNoteReport(noteId: String): Option[NoteReport] = { - notes.get(noteId) match { - case Some(note) => Some(noteToReport(note)) - case None => None - } - } - - def isNotesLimit: Boolean = { - notes.size >= maxNumberOfNotes - } - - private def noteToReport(note: Note): NoteReport = { - new NoteReport(note.name, note.document, note.patchCounter, !note.undoPatches.isEmpty, !note.redoPatches.isEmpty) - } -} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/ClearSharedNotePubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/ClearSharedNotePubMsgHdlr.scala deleted file mode 100755 index 018d497cd4cfa0326854bc26e6b62028742df78a..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/ClearSharedNotePubMsgHdlr.scala +++ /dev/null @@ -1,35 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.LiveMeeting -import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait } - -trait ClearSharedNotePubMsgHdlr extends RightsManagementTrait { - this: SharedNotesApp2x => - - def handle(msg: ClearSharedNotePubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: ClearSharedNotePubMsg, noteReport: NoteReport): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(SyncSharedNoteEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(SyncSharedNoteEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = SyncSharedNoteEvtMsgBody(msg.body.noteId, noteReport) - val event = SyncSharedNoteEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) { - val meetingId = liveMeeting.props.meetingProp.intId - val reason = "No permission to clear shared notes in meeting." - PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting) - } else { - liveMeeting.notesModel.clearNote(msg.body.noteId) match { - case Some(noteReport) => broadcastEvent(msg, noteReport) - case None => log.warning("Could not find note " + msg.body.noteId) - } - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/CreateSharedNoteReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/CreateSharedNoteReqMsgHdlr.scala deleted file mode 100755 index 0e778141f25e24e43c67858b7f17419a0a9235c1..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/CreateSharedNoteReqMsgHdlr.scala +++ /dev/null @@ -1,35 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.LiveMeeting -import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait } - -trait CreateSharedNoteReqMsgHdlr extends RightsManagementTrait { - this: SharedNotesApp2x => - - def handle(msg: CreateSharedNoteReqMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: CreateSharedNoteReqMsg, noteId: String, isNotesLimit: Boolean): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(CreateSharedNoteRespMsg.NAME, routing) - val header = BbbClientMsgHeader(CreateSharedNoteRespMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = CreateSharedNoteRespMsgBody(noteId, msg.body.noteName, isNotesLimit) - val event = CreateSharedNoteRespMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) { - val meetingId = liveMeeting.props.meetingProp.intId - val reason = "No permission to create new shared note." - PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting) - } else { - if (!liveMeeting.notesModel.isNotesLimit) { - val (noteId, isNotesLimit) = liveMeeting.notesModel.createNote(msg.body.noteName) - broadcastEvent(msg, noteId, isNotesLimit) - } - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/DestroySharedNoteReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/DestroySharedNoteReqMsgHdlr.scala deleted file mode 100755 index 73dbc6488f106aaf9c3fbd0a6344c9644e778af7..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/DestroySharedNoteReqMsgHdlr.scala +++ /dev/null @@ -1,33 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.LiveMeeting -import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait } - -trait DestroySharedNoteReqMsgHdlr extends RightsManagementTrait { - this: SharedNotesApp2x => - - def handle(msg: DestroySharedNoteReqMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: DestroySharedNoteReqMsg, isNotesLimit: Boolean): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(DestroySharedNoteRespMsg.NAME, routing) - val header = BbbClientMsgHeader(DestroySharedNoteRespMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = DestroySharedNoteRespMsgBody(msg.body.noteId, isNotesLimit) - val event = DestroySharedNoteRespMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - if (permissionFailed(PermissionCheck.MOD_LEVEL, PermissionCheck.VIEWER_LEVEL, liveMeeting.users2x, msg.header.userId)) { - val meetingId = liveMeeting.props.meetingProp.intId - val reason = "No permission to destory shared note." - PermissionCheck.ejectUserForFailedPermission(meetingId, msg.header.userId, reason, bus.outGW, liveMeeting) - } else { - val isNotesLimit = liveMeeting.notesModel.destroyNote(msg.body.noteId) - broadcastEvent(msg, isNotesLimit) - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/GetSharedNotesPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/GetSharedNotesPubMsgHdlr.scala deleted file mode 100755 index 807ddc3fce9733ab80babccea52dc04f61076ace..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/GetSharedNotesPubMsgHdlr.scala +++ /dev/null @@ -1,27 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting } - -trait GetSharedNotesPubMsgHdlr { - this: SharedNotesApp2x => - - def handle(msg: GetSharedNotesPubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: GetSharedNotesPubMsg, notesReport: Map[String, NoteReport], isNotesLimit: Boolean): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(GetSharedNotesEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(GetSharedNotesEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = GetSharedNotesEvtMsgBody(notesReport, isNotesLimit) - val event = GetSharedNotesEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - val isNotesLimit = liveMeeting.notesModel.isNotesLimit - val notesReport = liveMeeting.notesModel.notesReport.toMap - broadcastEvent(msg, notesReport, isNotesLimit) - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SharedNotesApp2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SharedNotesApp2x.scala deleted file mode 100755 index c37dbcb8e06b61673c11146dbc0405afd8969b3e..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SharedNotesApp2x.scala +++ /dev/null @@ -1,15 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import akka.actor.ActorContext -import akka.event.Logging - -class SharedNotesApp2x(implicit val context: ActorContext) - extends GetSharedNotesPubMsgHdlr - with SyncSharedNotePubMsgHdlr - with ClearSharedNotePubMsgHdlr - with UpdateSharedNoteReqMsgHdlr - with CreateSharedNoteReqMsgHdlr - with DestroySharedNoteReqMsgHdlr { - - val log = Logging(context.system, getClass) -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SyncSharedNotePubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SyncSharedNotePubMsgHdlr.scala deleted file mode 100755 index c278db65a0467717a352d7367ef63838cc88a084..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/SyncSharedNotePubMsgHdlr.scala +++ /dev/null @@ -1,28 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting } - -trait SyncSharedNotePubMsgHdlr { - this: SharedNotesApp2x => - - def handle(msg: SyncSharedNotePubMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: SyncSharedNotePubMsg, noteReport: NoteReport): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, liveMeeting.props.meetingProp.intId, msg.header.userId) - val envelope = BbbCoreEnvelope(SyncSharedNoteEvtMsg.NAME, routing) - val header = BbbClientMsgHeader(SyncSharedNoteEvtMsg.NAME, liveMeeting.props.meetingProp.intId, msg.header.userId) - - val body = SyncSharedNoteEvtMsgBody(msg.body.noteId, noteReport) - val event = SyncSharedNoteEvtMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - liveMeeting.notesModel.getNoteReport(msg.body.noteId) match { - case Some(noteReport) => broadcastEvent(msg, noteReport) - case None => log.warning("Could not find note " + msg.body.noteId) - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/UpdateSharedNoteReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/UpdateSharedNoteReqMsgHdlr.scala deleted file mode 100755 index 6919d8b87e7aba05d25d8ed6f2e1043c97444071..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/sharednotes/UpdateSharedNoteReqMsgHdlr.scala +++ /dev/null @@ -1,38 +0,0 @@ -package org.bigbluebutton.core.apps.sharednotes - -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.bus.MessageBus -import org.bigbluebutton.core.running.{ LiveMeeting } - -trait UpdateSharedNoteReqMsgHdlr { - this: SharedNotesApp2x => - - def handle(msg: UpdateSharedNoteReqMsg, liveMeeting: LiveMeeting, bus: MessageBus): Unit = { - - def broadcastEvent(msg: UpdateSharedNoteReqMsg, userId: String, patch: String, patchId: Int, undo: Boolean, redo: Boolean): Unit = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, liveMeeting.props.meetingProp.intId, userId) - val envelope = BbbCoreEnvelope(UpdateSharedNoteRespMsg.NAME, routing) - val header = BbbClientMsgHeader(UpdateSharedNoteRespMsg.NAME, liveMeeting.props.meetingProp.intId, userId) - - val body = UpdateSharedNoteRespMsgBody(msg.body.noteId, patch, patchId, undo, redo) - val event = UpdateSharedNoteRespMsg(header, body) - val msgEvent = BbbCommonEnvCoreMsg(envelope, event) - bus.outGW.send(msgEvent) - } - - val userId = msg.body.operation match { - case "PATCH" => msg.header.userId - case "UNDO" => liveMeeting.notesModel.SYSTEM_ID - case "REDO" => liveMeeting.notesModel.SYSTEM_ID - case _ => return - } - - val (patchId, patch, undo, redo) = liveMeeting.notesModel.patchNote(msg.body.noteId, msg.body.patch, msg.body.operation) - - if (patch != "") { - broadcastEvent(msg, userId, patch, patchId, undo, redo) - } else { - log.warning("Could not patch note " + msg.body.noteId) - } - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MeetingActivityResponseCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MeetingActivityResponseCmdMsgHdlr.scala deleted file mode 100755 index eca0ac65c35b1665efcf6ecfffa933281da78682..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MeetingActivityResponseCmdMsgHdlr.scala +++ /dev/null @@ -1,43 +0,0 @@ -package org.bigbluebutton.core.apps.users - -import org.bigbluebutton.common2.domain.DefaultProps -import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.domain.MeetingState2x -import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } - -trait MeetingActivityResponseCmdMsgHdlr { - this: UsersApp => - - val liveMeeting: LiveMeeting - val outGW: OutMsgRouter - - def handleMeetingActivityResponseCmdMsg( - msg: MeetingActivityResponseCmdMsg, - state: MeetingState2x - ): MeetingState2x = { - processMeetingActivityResponse(liveMeeting.props, outGW, msg) - val tracker = state.inactivityTracker.resetWarningSentAndTimestamp() - state.update(tracker) - } - - def processMeetingActivityResponse( - props: DefaultProps, - outGW: OutMsgRouter, - msg: MeetingActivityResponseCmdMsg - ): Unit = { - - def buildMeetingIsActiveEvtMsg(meetingId: String): BbbCommonEnvCoreMsg = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, "not-used") - val envelope = BbbCoreEnvelope(MeetingIsActiveEvtMsg.NAME, routing) - val body = MeetingIsActiveEvtMsgBody(meetingId) - val header = BbbClientMsgHeader(MeetingIsActiveEvtMsg.NAME, meetingId, "not-used") - val event = MeetingIsActiveEvtMsg(header, body) - - BbbCommonEnvCoreMsg(envelope, event) - } - - val event = buildMeetingIsActiveEvtMsg(props.meetingProp.intId) - outGW.send(event) - - } -} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala index eec9ff6431b2dde8df320067ec6dca4f9aea0619..dc13f8c106867dae8fe4e552351a0a0a7118d250 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala @@ -140,7 +140,6 @@ class UsersApp( with ChangeUserRoleCmdMsgHdlr with SyncGetUsersMeetingRespMsgHdlr with LogoutAndEndMeetingCmdMsgHdlr - with MeetingActivityResponseCmdMsgHdlr with SetRecordingStatusCmdMsgHdlr with RecordAndClearPreviousMarkersCmdMsgHdlr with SendRecordingTimerInternalMsgHdlr diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala index 5b405145f780ad298929aade560ed5d2ff9a7741..6a4bb41efb28b5c68845a5c83bdd9014d7a83863 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingState2x.scala @@ -12,7 +12,6 @@ case class MeetingState2x( groupChats: GroupChats, presentationPodManager: PresentationPodManager, breakout: Option[BreakoutModel], - inactivityTracker: MeetingInactivityTracker, expiryTracker: MeetingExpiryTracker, recordingTracker: MeetingRecordingTracker ) { @@ -21,13 +20,11 @@ case class MeetingState2x( def update(presPodManager: PresentationPodManager): MeetingState2x = copy(presentationPodManager = presPodManager) def update(breakout: Option[BreakoutModel]): MeetingState2x = copy(breakout = breakout) def update(expiry: MeetingExpiryTracker): MeetingState2x = copy(expiryTracker = expiry) - def update(inactivityTracker: MeetingInactivityTracker): MeetingState2x = copy(inactivityTracker = inactivityTracker) def update(recordingTracker: MeetingRecordingTracker): MeetingState2x = copy(recordingTracker = recordingTracker) } object MeetingEndReason { val ENDED_FROM_API = "ENDED_FROM_API" - val ENDED_DUE_TO_INACTIVITY = "ENDED_DUE_TO_INACTIVITY" val ENDED_WHEN_NOT_JOINED = "ENDED_WHEN_NOT_JOINED" val ENDED_WHEN_LAST_USER_LEFT = "ENDED_WHEN_LAST_USER_LEFT" val ENDED_AFTER_USER_LOGGED_OUT = "ENDED_AFTER_USER_LOGGED_OUT" diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingInactivityTracker.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingTrackers.scala similarity index 71% rename from akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingInactivityTracker.scala rename to akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingTrackers.scala index bdaaa48c72d89cc1e2002ed62faf09cbea34d18c..5b1c906870abc814289ade3d77b4b4213c1d271c 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingInactivityTracker.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/domain/MeetingTrackers.scala @@ -1,43 +1,5 @@ package org.bigbluebutton.core.domain -case class MeetingInactivityTracker( - val maxInactivityTimeoutInMs: Long, - val warningBeforeMaxInMs: Long, - lastActivityTimestampInMs: Long, - warningSent: Boolean, - warningSentOnTimestampInMs: Long -) { - def setWarningSentAndTimestamp(nowInMs: Long): MeetingInactivityTracker = { - copy(warningSent = true, warningSentOnTimestampInMs = nowInMs) - } - - def resetWarningSentAndTimestamp(): MeetingInactivityTracker = { - copy(warningSent = false, warningSentOnTimestampInMs = 0L) - } - - def updateLastActivityTimestamp(nowInMs: Long): MeetingInactivityTracker = { - copy(lastActivityTimestampInMs = nowInMs) - } - - def hasRecentActivity(nowInMs: Long): Boolean = { - val left = nowInMs - lastActivityTimestampInMs - val right = maxInactivityTimeoutInMs - warningBeforeMaxInMs - left < right - } - - def isMeetingInactive(nowInMs: Long): Boolean = { - if (maxInactivityTimeoutInMs > 0) { - warningSent && (nowInMs - lastActivityTimestampInMs) > maxInactivityTimeoutInMs - } else { - false - } - } - - def timeLeftInMs(nowInMs: Long): Long = { - lastActivityTimestampInMs + maxInactivityTimeoutInMs - nowInMs - } -} - case class MeetingExpiryTracker( startedOnInMs: Long, userHasJoined: Boolean, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 1842b9a24ed18138c39b045629f78ced7484775f..683f07d0b0aabcd85962600150d2e8d9751bb5d4 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -255,20 +255,6 @@ class ReceivedJsonMsgHandlerActor( case SendCaptionHistoryReqMsg.NAME => routeGenericMsg[SendCaptionHistoryReqMsg](envelope, jsonNode) - // Shared notes - case GetSharedNotesPubMsg.NAME => - routeGenericMsg[GetSharedNotesPubMsg](envelope, jsonNode) - case SyncSharedNotePubMsg.NAME => - routeGenericMsg[SyncSharedNotePubMsg](envelope, jsonNode) - case ClearSharedNotePubMsg.NAME => - routeGenericMsg[ClearSharedNotePubMsg](envelope, jsonNode) - case UpdateSharedNoteReqMsg.NAME => - routeGenericMsg[UpdateSharedNoteReqMsg](envelope, jsonNode) - case CreateSharedNoteReqMsg.NAME => - routeGenericMsg[CreateSharedNoteReqMsg](envelope, jsonNode) - case DestroySharedNoteReqMsg.NAME => - routeGenericMsg[DestroySharedNoteReqMsg](envelope, jsonNode) - // Chat case GetChatHistoryReqMsg.NAME => routeGenericMsg[GetChatHistoryReqMsg](envelope, jsonNode) @@ -284,8 +270,6 @@ class ReceivedJsonMsgHandlerActor( // Meeting case EndMeetingSysCmdMsg.NAME => routeGenericMsg[EndMeetingSysCmdMsg](envelope, jsonNode) - case MeetingActivityResponseCmdMsg.NAME => - routeGenericMsg[MeetingActivityResponseCmdMsg](envelope, jsonNode) case LogoutAndEndMeetingCmdMsg.NAME => routeGenericMsg[LogoutAndEndMeetingCmdMsg](envelope, jsonNode) case SetRecordingStatusCmdMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala index 31be44636ac04fa831be69bfa9d550fa2c4cef99..706dc2c7470bbf35b92bd1cabe465120126a4132 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/LiveMeeting.scala @@ -16,7 +16,6 @@ class LiveMeeting( val wbModel: WhiteboardModel, val presModel: PresentationModel, val captionModel: CaptionModel, - val notesModel: SharedNotesModel, val webcams: Webcams, val voiceUsers: VoiceUsers, val users2x: Users2x, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index c0a1735a92841210e0d1f19457236444c06383ef..8a1955c2e691dd618ca05957bee90d713673ab52 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -19,7 +19,6 @@ import org.bigbluebutton.core.apps.chat.ChatApp2x import org.bigbluebutton.core.apps.screenshare.ScreenshareApp2x import org.bigbluebutton.core.apps.presentation.PresentationApp2x import org.bigbluebutton.core.apps.users.UsersApp2x -import org.bigbluebutton.core.apps.sharednotes.SharedNotesApp2x import org.bigbluebutton.core.apps.whiteboard.WhiteboardApp2x import org.bigbluebutton.core.bus._ import org.bigbluebutton.core.models._ @@ -113,7 +112,6 @@ class MeetingActor( val presentationApp2x = new PresentationApp2x val screenshareApp2x = new ScreenshareApp2x val captionApp2x = new CaptionApp2x - val sharedNotesApp2x = new SharedNotesApp2x val chatApp2x = new ChatApp2x val usersApp = new UsersApp(liveMeeting, outGW, eventBus) val groupChatApp = new GroupChatHdlrs @@ -123,14 +121,6 @@ class MeetingActor( object ExpiryTrackerHelper extends MeetingExpiryTrackerHelper - val inactivityTracker = new MeetingInactivityTracker( - TimeUtil.minutesToMillis(props.durationProps.maxInactivityTimeoutMinutes), - TimeUtil.minutesToMillis(props.durationProps.warnMinutesBeforeMax), - lastActivityTimestampInMs = TimeUtil.timeNowInMs(), - warningSent = false, - warningSentOnTimestampInMs = 0L - ) - val expiryTracker = new MeetingExpiryTracker( startedOnInMs = TimeUtil.timeNowInMs(), userHasJoined = false, @@ -150,7 +140,6 @@ class MeetingActor( new GroupChats(Map.empty), new PresentationPodManager(Map.empty), None, - inactivityTracker, expiryTracker, recordingTracker ) @@ -271,11 +260,6 @@ class MeetingActor( } - private def updateInactivityTracker(state: MeetingState2x): MeetingState2x = { - val tracker = state.inactivityTracker.updateLastActivityTimestamp(TimeUtil.timeNowInMs()) - state.update(tracker) - } - private def updateVoiceUserLastActivity(userId: String) { for { vu <- VoiceUsers.findWithVoiceUserId(liveMeeting.voiceUsers, userId) @@ -294,14 +278,9 @@ class MeetingActor( private def handleBbbCommonEnvCoreMsg(msg: BbbCommonEnvCoreMsg): Unit = { msg.core match { - case m: ClientToServerLatencyTracerMsg => handleMessageThatDoesNotAffectsInactivity(msg) - case _ => handleMessageThatAffectsInactivity(msg) - } - } - - private def handleMessageThatDoesNotAffectsInactivity(msg: BbbCommonEnvCoreMsg): Unit = { - msg.core match { - case m: ClientToServerLatencyTracerMsg => handleClientToServerLatencyTracerMsg(m) + case m: ClientToServerLatencyTracerMsg => handleClientToServerLatencyTracerMsg(m) + case m: CheckRunningAndRecordingVoiceConfEvtMsg => handleCheckRunningAndRecordingVoiceConfEvtMsg(m) + case _ => handleMessageThatAffectsInactivity(msg) } } @@ -318,9 +297,6 @@ class MeetingActor( case m: UserBroadcastCamStartMsg => handleUserBroadcastCamStartMsg(m) case m: UserBroadcastCamStopMsg => handleUserBroadcastCamStopMsg(m) case m: UserJoinedVoiceConfEvtMsg => handleUserJoinedVoiceConfEvtMsg(m) - case m: MeetingActivityResponseCmdMsg => - state = usersApp.handleMeetingActivityResponseCmdMsg(m, state) - state = updateInactivityTracker(state) case m: LogoutAndEndMeetingCmdMsg => usersApp.handleLogoutAndEndMeetingCmdMsg(m, state) case m: SetRecordingStatusCmdMsg => state = usersApp.handleSetRecordingStatusCmdMsg(m, state) @@ -382,7 +358,6 @@ class MeetingActor( case m: UserLeftVoiceConfEvtMsg => handleUserLeftVoiceConfEvtMsg(m) case m: UserMutedInVoiceConfEvtMsg => handleUserMutedInVoiceConfEvtMsg(m) case m: UserTalkingInVoiceConfEvtMsg => - state = updateInactivityTracker(state) updateVoiceUserLastActivity(m.body.voiceUserId) handleUserTalkingInVoiceConfEvtMsg(m) case m: VoiceConfCallStateEvtMsg => handleVoiceConfCallStateEvtMsg(m) @@ -402,8 +377,6 @@ class MeetingActor( case m: UserConnectedToGlobalAudioMsg => handleUserConnectedToGlobalAudioMsg(m) case m: UserDisconnectedFromGlobalAudioMsg => handleUserDisconnectedFromGlobalAudioMsg(m) case m: VoiceConfRunningEvtMsg => handleVoiceConfRunningEvtMsg(m) - case m: CheckRunningAndRecordingVoiceConfEvtMsg => - handleCheckRunningAndRecordingVoiceConfEvtMsg(m) case m: UserStatusVoiceConfEvtMsg => handleUserStatusVoiceConfEvtMsg(m) @@ -448,14 +421,6 @@ class MeetingActor( case m: UpdateCaptionOwnerPubMsg => captionApp2x.handle(m, liveMeeting, msgBus) case m: SendCaptionHistoryReqMsg => captionApp2x.handle(m, liveMeeting, msgBus) - // SharedNotes - case m: GetSharedNotesPubMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - case m: SyncSharedNotePubMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - case m: ClearSharedNotePubMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - case m: UpdateSharedNoteReqMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - case m: CreateSharedNoteReqMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - case m: DestroySharedNoteReqMsg => sharedNotesApp2x.handle(m, liveMeeting, msgBus) - // Guests case m: GetGuestsWaitingApprovalReqMsg => handleGetGuestsWaitingApprovalReqMsg(m) case m: SetGuestPolicyCmdMsg => handleSetGuestPolicyMsg(m) @@ -565,12 +530,9 @@ class MeetingActor( def handleMonitorNumberOfUsers(msg: MonitorNumberOfUsersInternalMsg) { state = removeUsersWithExpiredUserLeftFlag(liveMeeting, state) - val (newState, expireReason) = ExpiryTrackerHelper.processMeetingInactivityAudit(outGW, eventBus, liveMeeting, state) + val (newState, expireReason) = ExpiryTrackerHelper.processMeetingExpiryAudit(outGW, eventBus, liveMeeting, state) state = newState expireReason foreach (reason => log.info("Meeting {} expired with reason {}", props.meetingProp.intId, reason)) - val (newState2, expireReason2) = ExpiryTrackerHelper.processMeetingExpiryAudit(outGW, eventBus, liveMeeting, state) - state = newState2 - expireReason2 foreach (reason => log.info("Meeting {} expired with reason {}", props.meetingProp.intId, reason)) sendRttTraceTest() setRecordingChapterBreak() diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelper.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelper.scala index db97ff69f6122f0cabb015265b57d9d09df90de1..21247da7a93338b89c78b0f5a8f5d6577333f959 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelper.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelper.scala @@ -27,44 +27,4 @@ trait MeetingExpiryTrackerHelper extends HandlerHelpers { (state, reason) } - - def processMeetingInactivityAudit( - outGW: OutMsgRouter, - eventBus: InternalEventBus, - liveMeeting: LiveMeeting, - state: MeetingState2x - ): (MeetingState2x, Option[String]) = { - - val nowInMs = TimeUtil.timeNowInMs() - if (!state.inactivityTracker.hasRecentActivity(nowInMs)) { - if (state.inactivityTracker.isMeetingInactive(nowInMs)) { - val expireReason = MeetingEndReason.ENDED_DUE_TO_INACTIVITY - endAllBreakoutRooms(eventBus, liveMeeting, state) - sendEndMeetingDueToExpiry(expireReason, eventBus, outGW, liveMeeting) - (state, Some(expireReason)) - } else { - if (!state.inactivityTracker.warningSent) { - val timeLeftSeconds = TimeUtil.millisToSeconds(state.inactivityTracker.timeLeftInMs(nowInMs)) - val event = buildMeetingInactivityWarningEvtMsg(liveMeeting.props.meetingProp.intId, timeLeftSeconds) - outGW.send(event) - val tracker = state.inactivityTracker.setWarningSentAndTimestamp(nowInMs) - (state.update(tracker), None) - } else { - (state, None) - } - } - } else { - (state, None) - } - } - - def buildMeetingInactivityWarningEvtMsg(meetingId: String, timeLeftInSec: Long): BbbCommonEnvCoreMsg = { - val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, "not-used") - val envelope = BbbCoreEnvelope(MeetingInactivityWarningEvtMsg.NAME, routing) - val body = MeetingInactivityWarningEvtMsgBody(timeLeftInSec) - val header = BbbClientMsgHeader(MeetingInactivityWarningEvtMsg.NAME, meetingId, "not-used") - val event = MeetingInactivityWarningEvtMsg(header, body) - - BbbCommonEnvCoreMsg(envelope, event) - } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala index 2d7e54f9ebcfb71b567501b71bdbbaea76c552ae..9d54c7c1847c0b75d8e6d03e1549197035196229 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/RunningMeeting.scala @@ -22,7 +22,6 @@ class RunningMeeting(val props: DefaultProps, outGW: OutMessageGateway, private val wbModel = new WhiteboardModel() private val presModel = new PresentationModel() private val captionModel = new CaptionModel() - private val notesModel = new SharedNotesModel() private val registeredUsers = new RegisteredUsers private val meetingStatux2x = new MeetingStatus2x private val webcams = new Webcams @@ -38,7 +37,7 @@ class RunningMeeting(val props: DefaultProps, outGW: OutMessageGateway, // easy to test. private val liveMeeting = new LiveMeeting(props, meetingStatux2x, deskshareModel, chatModel, layouts, registeredUsers, polls2x, wbModel, presModel, captionModel, - notesModel, webcams, voiceUsers, users2x, guestsWaiting) + webcams, voiceUsers, users2x, guestsWaiting) GuestsWaiting.setGuestPolicy( liveMeeting.guestsWaiting, diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala index 92aa396bd3cb9b5434fa8f64546595bbc8f21343..7c08cdfdfd49facb7e99a966b5a8934f213451b0 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/AnalyticsActor.scala @@ -49,7 +49,6 @@ class AnalyticsActor extends Actor with ActorLogging { case m: UserLeftMeetingEvtMsg => logMessage(msg) case m: PresenterUnassignedEvtMsg => logMessage(msg) case m: PresenterAssignedEvtMsg => logMessage(msg) - case m: MeetingIsActiveEvtMsg => logMessage(msg) case m: UserEjectedFromMeetingEvtMsg => logMessage(msg) case m: EjectUserFromVoiceConfSysMsg => logMessage(msg) case m: CreateBreakoutRoomSysCmdMsg => logMessage(msg) @@ -76,7 +75,6 @@ class AnalyticsActor extends Actor with ActorLogging { case m: ScreenshareStopRtmpBroadcastVoiceConfMsg => logMessage(msg) case m: ScreenshareRtmpBroadcastStartedEvtMsg => logMessage(msg) case m: ScreenshareRtmpBroadcastStoppedEvtMsg => logMessage(msg) - case m: MeetingInactivityWarningEvtMsg => logMessage(msg) case m: StartRecordingVoiceConfSysMsg => logMessage(msg) case m: StopRecordingVoiceConfSysMsg => logMessage(msg) //case m: UpdateRecordingTimerEvtMsg => logMessage(msg) diff --git a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala index 7f3c3e1a8e6c9c98ec53522252d9bf3087cb33a0..d82f2d88158949416a1445f52094a838bc455d6e 100755 --- a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala +++ b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/AppsTestFixtures.scala @@ -18,8 +18,6 @@ trait AppsTestFixtures { val muteOnStart = true val deskshareConfId = "85115-DESKSHARE" val durationInMinutes = 10 - val maxInactivityTimeoutMinutes = 120 - val warnMinutesBeforeMax = 30 val meetingExpireIfNoUserJoinedInMinutes = 5 val meetingExpireWhenLastUserLeftInMinutes = 10 val userInactivityInspectTimerInMinutes = 60 @@ -50,7 +48,7 @@ trait AppsTestFixtures { val meetingProp = MeetingProp(name = meetingName, extId = externalMeetingId, intId = meetingId, isBreakout = isBreakout.booleanValue()) - val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, maxInactivityTimeoutMinutes = maxInactivityTimeoutMinutes, warnMinutesBeforeMax = warnMinutesBeforeMax, + val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, meetingExpireIfNoUserJoinedInMinutes = meetingExpireIfNoUserJoinedInMinutes, meetingExpireWhenLastUserLeftInMinutes = meetingExpireWhenLastUserLeftInMinutes, userInactivityInspectTimerInMinutes = userInactivityInspectTimerInMinutes, userInactivityThresholdInMinutes = userInactivityInspectTimerInMinutes, userActivitySignResponseDelayInMinutes = userActivitySignResponseDelayInMinutes) val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword) @@ -72,7 +70,6 @@ trait AppsTestFixtures { val presModel = new PresentationModel() val breakoutRooms = new BreakoutRooms() val captionModel = new CaptionModel() - val notesModel = new SharedNotesModel() val registeredUsers = new RegisteredUsers val meetingStatux2x = new MeetingStatus2x val webcams = new Webcams @@ -88,7 +85,6 @@ trait AppsTestFixtures { val wbModel = new WhiteboardModel() val presModel = new PresentationModel() val captionModel = new CaptionModel() - val notesModel = new SharedNotesModel() val registeredUsers = new RegisteredUsers val meetingStatux2x = new MeetingStatus2x val webcams = new Webcams @@ -102,6 +98,6 @@ trait AppsTestFixtures { // easy to test. new LiveMeeting(defaultProps, meetingStatux2x, deskshareModel, chatModel, layouts, registeredUsers, polls2x, wbModel, presModel, captionModel, - notesModel, webcams, voiceUsers, users2x, guestsWaiting) + webcams, voiceUsers, users2x, guestsWaiting) } } diff --git a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/domain/MeetingInactivityTrackerTests.scala b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/domain/MeetingInactivityTrackerTests.scala deleted file mode 100755 index 95f8ab07d9f674a95c649813b873fe8e5c11c6da..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/domain/MeetingInactivityTrackerTests.scala +++ /dev/null @@ -1,37 +0,0 @@ -package org.bigbluebutton.core.domain - -import org.bigbluebutton.core.UnitSpec -import org.bigbluebutton.core.util.TimeUtil - -class MeetingInactivityTrackerTests extends UnitSpec { - - "A MeetingInactivityTrackerHelper" should "be return meeting is inactive" in { - val nowInMinutes = TimeUtil.minutesToSeconds(15) - - val inactivityTracker = new MeetingInactivityTracker( - maxInactivityTimeoutInMs = 12, - warningBeforeMaxInMs = 2, - lastActivityTimestampInMs = TimeUtil.minutesToSeconds(5), - warningSent = true, - warningSentOnTimestampInMs = 0L - ) - - val active = inactivityTracker.isMeetingInactive(nowInMinutes) - assert(active == true) - } - - "A MeetingInactivityTrackerHelper" should "be return meeting is active" in { - val nowInMinutes = TimeUtil.minutesToSeconds(18) - val inactivityTracker = new MeetingInactivityTracker( - maxInactivityTimeoutInMs = 12, - warningBeforeMaxInMs = 2, - lastActivityTimestampInMs = TimeUtil.minutesToSeconds(5), - warningSent = true, - warningSentOnTimestampInMs = 0L - ) - - val inactive = inactivityTracker.isMeetingInactive(nowInMinutes) - assert(inactive) - } - -} diff --git a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelperTests.scala b/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelperTests.scala deleted file mode 100755 index 871dcab1f850379f06da4d0657d231aa58a5280c..0000000000000000000000000000000000000000 --- a/akka-bbb-apps/src/test/scala/org/bigbluebutton/core/running/MeetingExpiryTrackerHelperTests.scala +++ /dev/null @@ -1,38 +0,0 @@ -package org.bigbluebutton.core.running - -import org.bigbluebutton.core.UnitSpec -import org.bigbluebutton.core.domain.MeetingInactivityTracker -import org.bigbluebutton.core.util.TimeUtil - -class MeetingExpiryTrackerHelperTests extends UnitSpec { - - "A MeetingInactivityTrackerHelper" should "be return meeting is inactive" in { - val nowInMinutes = TimeUtil.minutesToSeconds(15) - - val inactivityTracker = new MeetingInactivityTracker( - maxInactivityTimeoutInMs = 12, - warningBeforeMaxInMs = 2, - lastActivityTimestampInMs = TimeUtil.minutesToSeconds(5), - warningSent = true, - warningSentOnTimestampInMs = 0L - ) - - val active = inactivityTracker.isMeetingInactive(nowInMinutes) - assert(active == true) - } - - "A MeetingInactivityTrackerHelper" should "be return meeting is active" in { - val nowInMinutes = TimeUtil.minutesToSeconds(18) - val inactivityTracker = new MeetingInactivityTracker( - maxInactivityTimeoutInMs = 12, - warningBeforeMaxInMs = 2, - lastActivityTimestampInMs = TimeUtil.minutesToSeconds(5), - warningSent = true, - warningSentOnTimestampInMs = 0L - ) - - val inactive = inactivityTracker.isMeetingInactive(nowInMinutes) - assert(inactive) - } - -} diff --git a/akka-bbb-apps/src/universal/conf/application.conf b/akka-bbb-apps/src/universal/conf/application.conf index 4bf02465c110384b5dc578c836d2b4b2cd433ff5..ff2f57e4ecdf6fb5798807d1eaff8f297ec55a40 100755 --- a/akka-bbb-apps/src/universal/conf/application.conf +++ b/akka-bbb-apps/src/universal/conf/application.conf @@ -59,11 +59,6 @@ eventBus { outBbbMsgMsgChannel = "OutBbbMsgChannel" } -sharedNotes { - maxNumberOfNotes = 3 - maxNumberOfUndos = 30 -} - http { interface = "127.0.0.1" port = 9999 diff --git a/bbb-apps-common/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala b/bbb-apps-common/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala index 7a81d284bafc6ce326c912ed9455a0a873525b6a..e26221c1711c6a09ee579aa13b7ca23f71ea6bee 100644 --- a/bbb-apps-common/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala +++ b/bbb-apps-common/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala @@ -22,7 +22,6 @@ object AllowedMessageNames { UserBroadcastCamStopMsg.NAME, LogoutAndEndMeetingCmdMsg.NAME, GetRecordingStatusReqMsg.NAME, - MeetingActivityResponseCmdMsg.NAME, SetRecordingStatusCmdMsg.NAME, EjectUserFromMeetingCmdMsg.NAME, IsMeetingMutedReqMsg.NAME, @@ -88,14 +87,6 @@ object AllowedMessageNames { UpdateCaptionOwnerPubMsg.NAME, EditCaptionHistoryPubMsg.NAME, - // Shared Notes Messages - GetSharedNotesPubMsg.NAME, - CreateSharedNoteReqMsg.NAME, - DestroySharedNoteReqMsg.NAME, - UpdateSharedNoteReqMsg.NAME, - SyncSharedNotePubMsg.NAME, - ClearSharedNotePubMsg.NAME, - // Layout Messages GetCurrentLayoutReqMsg.NAME, BroadcastLayoutMsg.NAME, diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala index 2edcbabaab3256ee3717da0c9e0e85e466c63fc1..805a2ab0af169272c52b3d0474f398c8d8ca28bc 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/domain/Meeting2x.scala @@ -3,7 +3,6 @@ package org.bigbluebutton.common2.domain case class ConfigProps(defaultConfigToken: String, config: String) case class DurationProps(duration: Int, createdTime: Long, createdDate: String, - maxInactivityTimeoutMinutes: Int, warnMinutesBeforeMax: Int, meetingExpireIfNoUserJoinedInMinutes: Int, meetingExpireWhenLastUserLeftInMinutes: Int, userInactivityInspectTimerInMinutes: Int, userInactivityThresholdInMinutes: Int, userActivitySignResponseDelayInMinutes: Int) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SharedNotesMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SharedNotesMsgs.scala deleted file mode 100644 index d2cde012b11f949961e99807abfa9fb8830d5f5c..0000000000000000000000000000000000000000 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SharedNotesMsgs.scala +++ /dev/null @@ -1,65 +0,0 @@ -package org.bigbluebutton.common2.msgs - -import scala.collection.immutable.List - -case class Note( - name: String, - document: String, - patchCounter: Int, - undoPatches: List[(String, String)], - redoPatches: List[(String, String)] -) - -case class NoteReport( - name: String, - document: String, - patchCounter: Int, - undo: Boolean, - redo: Boolean -) - -/* In Messages */ -object GetSharedNotesPubMsg { val NAME = "GetSharedNotesPubMsg" } -case class GetSharedNotesPubMsg(header: BbbClientMsgHeader, body: GetSharedNotesPubMsgBody) extends StandardMsg -case class GetSharedNotesPubMsgBody() - -object SyncSharedNotePubMsg { val NAME = "SyncSharedNotePubMsg" } -case class SyncSharedNotePubMsg(header: BbbClientMsgHeader, body: SyncSharedNotePubMsgBody) extends StandardMsg -case class SyncSharedNotePubMsgBody(noteId: String) - -object UpdateSharedNoteReqMsg { val NAME = "UpdateSharedNoteReqMsg" } -case class UpdateSharedNoteReqMsg(header: BbbClientMsgHeader, body: UpdateSharedNoteReqMsgBody) extends StandardMsg -case class UpdateSharedNoteReqMsgBody(noteId: String, patch: String, operation: String) - -object ClearSharedNotePubMsg { val NAME = "ClearSharedNotePubMsg" } -case class ClearSharedNotePubMsg(header: BbbClientMsgHeader, body: ClearSharedNotePubMsgBody) extends StandardMsg -case class ClearSharedNotePubMsgBody(noteId: String) - -object CreateSharedNoteReqMsg { val NAME = "CreateSharedNoteReqMsg" } -case class CreateSharedNoteReqMsg(header: BbbClientMsgHeader, body: CreateSharedNoteReqMsgBody) extends StandardMsg -case class CreateSharedNoteReqMsgBody(noteName: String) - -object DestroySharedNoteReqMsg { val NAME = "DestroySharedNoteReqMsg" } -case class DestroySharedNoteReqMsg(header: BbbClientMsgHeader, body: DestroySharedNoteReqMsgBody) extends StandardMsg -case class DestroySharedNoteReqMsgBody(noteId: String) - -/* Out Messages */ -object GetSharedNotesEvtMsg { val NAME = "GetSharedNotesEvtMsg" } -case class GetSharedNotesEvtMsg(header: BbbClientMsgHeader, body: GetSharedNotesEvtMsgBody) extends StandardMsg -case class GetSharedNotesEvtMsgBody(notesReport: Map[String, NoteReport], isNotesLimit: Boolean) - -object SyncSharedNoteEvtMsg { val NAME = "SyncSharedNoteEvtMsg" } -case class SyncSharedNoteEvtMsg(header: BbbClientMsgHeader, body: SyncSharedNoteEvtMsgBody) extends StandardMsg -case class SyncSharedNoteEvtMsgBody(noteId: String, noteReport: NoteReport) - -object UpdateSharedNoteRespMsg { val NAME = "UpdateSharedNoteRespMsg" } -case class UpdateSharedNoteRespMsg(header: BbbClientMsgHeader, body: UpdateSharedNoteRespMsgBody) extends StandardMsg -case class UpdateSharedNoteRespMsgBody(noteId: String, patch: String, patchId: Int, undo: Boolean, redo: Boolean) - -object CreateSharedNoteRespMsg { val NAME = "CreateSharedNoteRespMsg" } -case class CreateSharedNoteRespMsg(header: BbbClientMsgHeader, body: CreateSharedNoteRespMsgBody) extends StandardMsg -case class CreateSharedNoteRespMsgBody(noteId: String, noteName: String, isNotesLimit: Boolean) - -object DestroySharedNoteRespMsg { val NAME = "DestroySharedNoteRespMsg" } -case class DestroySharedNoteRespMsg(header: BbbClientMsgHeader, body: DestroySharedNoteRespMsgBody) extends StandardMsg -case class DestroySharedNoteRespMsgBody(noteId: String, isNotesLimit: Boolean) \ No newline at end of file diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala index 0337441ffd7fb3a8c4087e58d2fa2a32af061837..c5df737ab485fb9f1578a848071389b3986b8efc 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/SystemMsgs.scala @@ -159,20 +159,6 @@ case class MeetingTimeRemainingUpdateEvtMsg( ) extends BbbCoreMsg case class MeetingTimeRemainingUpdateEvtMsgBody(timeLeftInSec: Long) -object MeetingInactivityWarningEvtMsg { val NAME = "MeetingInactivityWarningEvtMsg" } -case class MeetingInactivityWarningEvtMsg( - header: BbbClientMsgHeader, - body: MeetingInactivityWarningEvtMsgBody -) extends BbbCoreMsg -case class MeetingInactivityWarningEvtMsgBody(timeLeftInSec: Long) - -object MeetingIsActiveEvtMsg { val NAME = "MeetingIsActiveEvtMsg" } -case class MeetingIsActiveEvtMsg( - header: BbbClientMsgHeader, - body: MeetingIsActiveEvtMsgBody -) extends BbbCoreMsg -case class MeetingIsActiveEvtMsgBody(meetingId: String) - object CheckAlivePingSysMsg { val NAME = "CheckAlivePingSysMsg" } case class CheckAlivePingSysMsg( header: BbbCoreBaseHeader, diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala index d658d5236580558a9890d4d7f01b0e75c3a6d3a5..3d62d9dfa43bc15dc61f60809c548acba2d3599d 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala @@ -198,13 +198,6 @@ object AssignPresenterReqMsg { val NAME = "AssignPresenterReqMsg" } case class AssignPresenterReqMsg(header: BbbClientMsgHeader, body: AssignPresenterReqMsgBody) extends StandardMsg case class AssignPresenterReqMsgBody(requesterId: String, newPresenterId: String, newPresenterName: String, assignedBy: String) -/** - * Sent from client as a response to inactivity notifaction from server. - */ -object MeetingActivityResponseCmdMsg { val NAME = "MeetingActivityResponseCmdMsg" } -case class MeetingActivityResponseCmdMsg(header: BbbClientMsgHeader, body: MeetingActivityResponseCmdMsgBody) extends StandardMsg -case class MeetingActivityResponseCmdMsgBody(respondedBy: String) - /** * Sent from client to change the role of the user in the meeting. */ diff --git a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala index c7fc088b818abdd5e772186263b366d579c193a8..158a4a324c9231889b45fa466d72529879398b7e 100755 --- a/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala +++ b/bbb-common-message/src/test/scala/org/bigbluebutton/common2/TestFixtures.scala @@ -12,8 +12,6 @@ trait TestFixtures { val voiceConfId = "85115" val durationInMinutes = 10 - val maxInactivityTimeoutMinutes = 120 - val warnMinutesBeforeMax = 30 val meetingExpireIfNoUserJoinedInMinutes = 5 val meetingExpireWhenLastUserLeftInMinutes = 10 val userInactivityInspectTimerInMinutes = 60 @@ -43,7 +41,7 @@ trait TestFixtures { isBreakout = isBreakout.booleanValue()) val breakoutProps = BreakoutProps(parentId = parentMeetingId, sequence = sequence, freeJoin = false, breakoutRooms = Vector()) - val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, maxInactivityTimeoutMinutes = maxInactivityTimeoutMinutes, warnMinutesBeforeMax = warnMinutesBeforeMax, + val durationProps = DurationProps(duration = durationInMinutes, createdTime = createTime, createdDate = createDate, meetingExpireIfNoUserJoinedInMinutes = meetingExpireIfNoUserJoinedInMinutes, meetingExpireWhenLastUserLeftInMinutes = meetingExpireWhenLastUserLeftInMinutes, userInactivityInspectTimerInMinutes = userInactivityInspectTimerInMinutes, userInactivityThresholdInMinutes = userInactivityInspectTimerInMinutes, userActivitySignResponseDelayInMinutes = userActivitySignResponseDelayInMinutes) val password = PasswordProp(moderatorPass = moderatorPassword, viewerPass = viewerPassword) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index 27127dfc2efddf4c5f6addf6c74ba683f24ce2f2..27aed4a1e16423e457e3ef1ddda337c4b1c2efbf 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -348,7 +348,7 @@ public class MeetingService implements MessageListener { m.getWebcamsOnlyForModerator(), m.getModeratorPassword(), m.getViewerPassword(), m.getCreateTime(), formatPrettyDate(m.getCreateTime()), m.isBreakout(), m.getSequence(), m.isFreeJoin(), m.getMetadata(), m.getGuestPolicy(), m.getWelcomeMessageTemplate(), m.getWelcomeMessage(), m.getModeratorOnlyMessage(), - m.getDialNumber(), m.getMaxUsers(), m.getMaxInactivityTimeoutMinutes(), m.getWarnMinutesBeforeMax(), + m.getDialNumber(), m.getMaxUsers(), m.getMeetingExpireIfNoUserJoinedInMinutes(), m.getmeetingExpireWhenLastUserLeftInMinutes(), m.getUserInactivityInspectTimerInMinutes(), m.getUserInactivityThresholdInMinutes(), m.getUserActivitySignResponseDelayInMinutes(), m.getMuteOnStart(), m.getAllowModsToUnmuteUsers(), keepEvents, diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index 89930a94b7d663ee871af67c283987f7107d9580..7b8d26d6a2daf9e4abef7128c6dfa537921aedba 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -107,9 +107,7 @@ public class ParamsProcessorUtil { private Long maxPresentationFileUpload = 30000000L; // 30MB - private Integer maxInactivityTimeoutMinutes = 120; private Integer clientLogoutTimerInMinutes = 0; - private Integer warnMinutesBeforeMax = 5; private Integer meetingExpireIfNoUserJoinedInMinutes = 5; private Integer meetingExpireWhenLastUserLeftInMinutes = 1; private Integer userInactivityInspectTimerInMinutes = 120; @@ -489,8 +487,6 @@ public class ParamsProcessorUtil { meeting.setModeratorOnlyMessage(moderatorOnlyMessage); } - meeting.setMaxInactivityTimeoutMinutes(maxInactivityTimeoutMinutes); - meeting.setWarnMinutesBeforeMax(warnMinutesBeforeMax); meeting.setMeetingExpireIfNoUserJoinedInMinutes(meetingExpireIfNoUserJoinedInMinutes); meeting.setMeetingExpireWhenLastUserLeftInMinutes(meetingExpireWhenLastUserLeftInMinutes); meeting.setUserInactivityInspectTimerInMinutes(userInactivityInspectTimerInMinutes); @@ -949,26 +945,10 @@ public class ParamsProcessorUtil { this.defaultGuestPolicy = guestPolicy; } - public void setMaxInactivityTimeoutMinutes(Integer value) { - maxInactivityTimeoutMinutes = value; - } - public void setClientLogoutTimerInMinutes(Integer value) { clientLogoutTimerInMinutes = value; } - public void setWarnMinutesBeforeMax(Integer value) { - warnMinutesBeforeMax = value; - } - - public Integer getMaxInactivityTimeoutMinutes() { - return maxInactivityTimeoutMinutes; - } - - public Integer getWarnMinutesBeforeMax() { - return warnMinutesBeforeMax; - } - public void setMeetingExpireWhenLastUserLeftInMinutes(Integer value) { meetingExpireWhenLastUserLeftInMinutes = value; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index 4709fe49dec5701e54bc20d504f428acf22300aa..0ca24f42ddb7cccdb0fa5e9b1a6c083b262fe1f9 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -81,8 +81,6 @@ public class Meeting { private Boolean muteOnStart = false; private Boolean allowModsToUnmuteUsers = false; - private Integer maxInactivityTimeoutMinutes = 120; - private Integer warnMinutesBeforeMax = 5; private Integer meetingExpireIfNoUserJoinedInMinutes = 5; private Integer meetingExpireWhenLastUserLeftInMinutes = 1; private Integer userInactivityInspectTimerInMinutes = 120; @@ -524,22 +522,6 @@ public class Meeting { userCustomData.put(userID, data); } - public void setMaxInactivityTimeoutMinutes(Integer value) { - maxInactivityTimeoutMinutes = value; - } - - public void setWarnMinutesBeforeMax(Integer value) { - warnMinutesBeforeMax = value; - } - - public Integer getMaxInactivityTimeoutMinutes() { - return maxInactivityTimeoutMinutes; - } - - public Integer getWarnMinutesBeforeMax() { - return warnMinutesBeforeMax; - } - public void setMeetingExpireWhenLastUserLeftInMinutes(Integer value) { meetingExpireWhenLastUserLeftInMinutes = value; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java index be5c15f991d5389b1396246cb8f1471f351c39c6..0cd5d114f0f86aeb447834de83e4cb3539f5d372 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api2/IBbbWebApiGWApp.java @@ -21,7 +21,6 @@ public interface IBbbWebApiGWApp { String createDate, Boolean isBreakout, Integer sequence, Boolean freejoin, Map<String, String> metadata, String guestPolicy, String welcomeMsgTemplate, String welcomeMsg, String modOnlyMessage, String dialNumber, Integer maxUsers, - Integer maxInactivityTimeoutMinutes, Integer warnMinutesBeforeMax, Integer meetingExpireIfNoUserJoinedInMinutes, Integer meetingExpireWhenLastUserLeftInMinutes, Integer userInactivityInspectTimerInMinutes, diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala index ac6ec822bd7a5cf32e89ed40f92657bf05dd23be..bb98953624cb95a0b4ee15a9bb68b2e3eca43f20 100755 --- a/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api2/BbbWebApiGWApp.scala @@ -129,8 +129,7 @@ class BbbWebApiGWApp( freeJoin: java.lang.Boolean, metadata: java.util.Map[String, String], guestPolicy: String, welcomeMsgTemplate: String, welcomeMsg: String, modOnlyMessage: String, - dialNumber: String, maxUsers: java.lang.Integer, maxInactivityTimeoutMinutes: java.lang.Integer, - warnMinutesBeforeMax: java.lang.Integer, + dialNumber: String, maxUsers: java.lang.Integer, meetingExpireIfNoUserJoinedInMinutes: java.lang.Integer, meetingExpireWhenLastUserLeftInMinutes: java.lang.Integer, userInactivityInspectTimerInMinutes: java.lang.Integer, @@ -147,8 +146,6 @@ class BbbWebApiGWApp( val durationProps = DurationProps( duration = duration.intValue(), createdTime = createTime.longValue(), createDate, - maxInactivityTimeoutMinutes = maxInactivityTimeoutMinutes.intValue(), - warnMinutesBeforeMax = warnMinutesBeforeMax.intValue(), meetingExpireIfNoUserJoinedInMinutes = meetingExpireIfNoUserJoinedInMinutes.intValue(), meetingExpireWhenLastUserLeftInMinutes = meetingExpireWhenLastUserLeftInMinutes.intValue(), userInactivityInspectTimerInMinutes = userInactivityInspectTimerInMinutes.intValue(), diff --git a/bbb-libreoffice/docker/Dockerfile b/bbb-libreoffice/docker/Dockerfile index 3f8a9983e9a8e171a33858f4ba7af7d2eb5e7bc7..0a9170018ef1c453b4178f0aa53eae7605ec84cd 100644 --- a/bbb-libreoffice/docker/Dockerfile +++ b/bbb-libreoffice/docker/Dockerfile @@ -5,7 +5,8 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt update RUN apt -y install locales-all fontconfig libxt6 libxrender1 -RUN apt -y install libreoffice --no-install-recommends +RUN apt -y install --no-install-recommends libreoffice fonts-crosextra-carlito fonts-crosextra-caladea fonts-noto + RUN dpkg-reconfigure fontconfig && fc-cache -f -s -v diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/events/BBBEvent.as b/bigbluebutton-client/src/org/bigbluebutton/main/events/BBBEvent.as index b8409bba7b2113b594d820f47a714ceb5a99d3ec..36bddc5d42986cce80abecbec3e4305fa02934e8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/events/BBBEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/events/BBBEvent.as @@ -24,9 +24,6 @@ package org.bigbluebutton.main.events { public static const END_MEETING_EVENT:String = 'END_MEETING_EVENT'; public static const LOGOUT_END_MEETING_EVENT:String = 'LOGOUT_END_MEETING_EVENT'; public static const CONFIRM_LOGOUT_END_MEETING_EVENT:String = 'CONFIRM_LOGOUT_END_MEETING_EVENT'; - public static const INACTIVITY_WARNING_EVENT:String = 'INACTIVITY_WARNING_EVENT'; - public static const ACTIVITY_RESPONSE_EVENT:String = 'ACTIVITY_RESPONSE_EVENT'; - public static const MEETING_IS_ACTIVE_EVENT:String = 'MEETING_IS_ACTIVE_EVENT'; public static const LOGIN_EVENT:String = 'loginEvent'; public static const RECEIVED_PUBLIC_CHAT_MESSAGE_EVENT:String = 'RECEIVED_PUBLIC_CHAT_MESSAGE_EVENT'; public static const SEND_PUBLIC_CHAT_MESSAGE_EVENT:String = 'SEND_PUBLIC_CHAT_MESSAGE_EVENT'; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as index 4d2f30ff555c178f6176479f6e5362625dbe1096..15efcb0ed5570629d0924ebf65a68cc15c7ec3c2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as @@ -190,10 +190,6 @@ package org.bigbluebutton.main.model.users } } - public function activityResponse():void { - sender.activityResponse(); - } - public function userActivitySignResponse():void { sender.userActivitySignResponse(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/InactivityWarningWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/InactivityWarningWindow.mxml deleted file mode 100755 index c90670970ae83d9dcba7bf15e8eafd740fc5744a..0000000000000000000000000000000000000000 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/InactivityWarningWindow.mxml +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- - -BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ - -Copyright (c) 2015 BigBlueButton Inc. and by respective authors (see below). - -This program is free software; you can redistribute it and/or modify it under the -terms of the GNU Lesser General Public License as published by the Free Software -Foundation; either version 3.0 of the License, or (at your option) any later -version. - -BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License along -with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. - ---> - -<mx:TitleWindow xmlns:mx="library://ns.adobe.com/flex/mx" - xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:mate="http://mate.asfusion.com/" - xmlns:common="org.bigbluebutton.common.*" - verticalScrollPolicy="off" - horizontalScrollPolicy="off" - horizontalAlign="center" - minWidth="500" - creationComplete="onCreationComplete()"> - - <fx:Declarations> - <mate:Listener type="{BBBEvent.MEETING_IS_ACTIVE_EVENT}" method="meetingIsActiveFeedback"/> - </fx:Declarations> - - <fx:Script> - <![CDATA[ - import com.asfusion.mate.events.Dispatcher; - - import mx.managers.PopUpManager; - - import org.as3commons.logging.api.ILogger; - import org.as3commons.logging.api.getClassLogger; - import org.bigbluebutton.main.events.BBBEvent; - import org.bigbluebutton.util.i18n.ResourceUtil; - - private static const LOGGER:ILogger = getClassLogger(InactivityWarningWindow); - - public var duration:Number = 0; - private var tickTimer:Timer; - - [Bindable] - private var cancelButtonLabel:String = ResourceUtil.getInstance().getString('bbb.inactivityWarning.cancel'); - - private function onCreationComplete():void { - tickTimer = new Timer(1000, 0); - tickTimer.addEventListener(TimerEvent.TIMER, tick); - - cancelButton.width = cancelButton.measureText(genCancelButtonLabel(duration)).width - + cancelButton.getStyle("paddingRight") - + cancelButton.getStyle("paddingLeft") - + 8; // 8 is magic number - - tickTimer.start(); - cancelButton.visible = true; - } - - private function tick(e:TimerEvent):void { - if (duration > 0) { - cancelButton.label = genCancelButtonLabel(duration); - warningMessage.text = genWarningMessageText(duration); - duration--; - } else { - tickTimer.stop(); - cancelButton.visible = false; - cancelButton.includeInLayout = false; - warningMessage.text = ResourceUtil.getInstance().getString('bbb.shuttingDown.message'); - } - } - - private function genWarningMessageText(timeLeft:Number):String { - return ResourceUtil.getInstance().getString('bbb.inactivityWarning.message', [timeLeft.toString()]); - } - - private function genCancelButtonLabel(timeLeft:Number):String { - return cancelButtonLabel; // + " (" + timeLeft.toString() + ")"; - } - - private function meetingIsActiveFeedback(e:BBBEvent):void { - tickTimer.stop(); - PopUpManager.removePopUp(this); - } - - private function cancelButtonClicked():void { - var dispatcher:Dispatcher = new Dispatcher(); - var bbbEvent:BBBEvent = new BBBEvent(BBBEvent.ACTIVITY_RESPONSE_EVENT); - dispatcher.dispatchEvent(bbbEvent); - } - ]]> - </fx:Script> - <mx:VBox width="100%" height="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5" horizontalAlign="center" verticalAlign="middle"> - <common:AdvancedLabel text="{ResourceUtil.getInstance().getString('bbb.inactivityWarning.title')}" - styleName="titleWindowStyle" - width="{this.width - 40}" /> - <mx:Text id="warningMessage" selectable="false"/> - <mx:Button id="cancelButton" click="cancelButtonClicked()" visible="false" styleName="mainActionButton"/> - </mx:VBox> -</mx:TitleWindow> \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 162c8f26895c3cff7578ae034fa675fcfd2341fe..080850de2ac7c009d2570673d0aab4852e980341 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -61,7 +61,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <mate:Listener type="{ToolbarButtonEvent.REMOVE}" method="handleRemoveToolbarComponent"/> <mate:Listener type="{ShortcutEvent.OPEN_SHORTCUT_WIN}" method="openShortcutHelpWindow" /> <mate:Listener type="{BBBEvent.OPEN_WEBCAM_PREVIEW}" method="openVideoPreviewWindow" /> - <mate:Listener type="{BBBEvent.INACTIVITY_WARNING_EVENT}" method="handleInactivityWarningEvent" /> <mate:Listener type="{BBBEvent.USER_INACTIVITY_INSPECT_EVENT}" method="handleUserInactivityInspectEvent" /> <mate:Listener type="{LockControlEvent.OPEN_LOCK_SETTINGS}" method="openLockSettingsWindow" /> <mate:Listener type="{BreakoutRoomEvent.OPEN_BREAKOUT_ROOMS_PANEL}" method="openBreakoutRoomsWindow" /> @@ -517,11 +516,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. inactivityWarning.duration = e.payload.responseDelay; } - private function handleInactivityWarningEvent(e:BBBEvent):void { - var inactivityWarning:InactivityWarningWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, InactivityWarningWindow, true) as InactivityWarningWindow; - inactivityWarning.duration = e.payload.duration; - } - private function handleFlashMicSettingsEvent(event:FlashMicSettingsEvent):void { /** * There is a bug in Flex SDK 4.14 where the screen stays blurry if a diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/monitoring/maps/MonitoringEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/monitoring/maps/MonitoringEventMap.mxml index 4270c2cf9746ee28191abf54082dbe59abfa6788..469fcd3d9a465495c9f78fbf82e52386bf19d444 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/monitoring/maps/MonitoringEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/monitoring/maps/MonitoringEventMap.mxml @@ -24,10 +24,6 @@ <InlineInvoker method="{MonitoringModule.handleStreamEventStarted}"/> </EventHandlers> - <EventHandlers type="{BBBEvent.ACTIVITY_RESPONSE_EVENT}" > - <InlineInvoker method="{MonitoringModule.handleAddedListenerEvent}" arguments="{[event]}" /> - </EventHandlers> - <EventHandlers type="{BBBEvent.VIDEO_STARTED}" > <InlineInvoker method="{MonitoringModule.videoHasStarted}" arguments="{[event]}" /> </EventHandlers> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/maps/UsersMainEventMap.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/maps/UsersMainEventMap.mxml index 141a45fef336e7428e2bc8710ae179dd6ce8bbf5..3e7263689f5b71e00932a547d43c22aeb96a9eb9 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/maps/UsersMainEventMap.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/maps/UsersMainEventMap.mxml @@ -120,10 +120,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <MethodInvoker generator="{UserService}" method="recordAndClearPreviousMarkers" arguments="{event}" /> </EventHandlers> - <EventHandlers type="{BBBEvent.ACTIVITY_RESPONSE_EVENT}"> - <MethodInvoker generator="{UserService}" method="activityResponse" /> - </EventHandlers> - <EventHandlers type="{BBBEvent.USER_ACTIVITY_SIGN_RESPONSE_EVENT}"> <MethodInvoker generator="{UserService}" method="userActivitySignResponse" /> </EventHandlers> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index ddf6fc5d6baf5c1881cd1f7d8ce9f89e589fbffa..fa377cf627a33dd9be53151abbe1e19fad04c88d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -137,12 +137,6 @@ package org.bigbluebutton.modules.users.services case "IsMeetingMutedRespMsg": handleIsMeetingMutedResp(message); break; - case "MeetingInactivityWarningEvtMsg": - handleInactivityWarning(message); - break; - case "MeetingIsActiveEvtMsg": - handleMeetingIsActive(message); - break; case "UserEmojiChangedEvtMsg": handleEmojiStatusHand(message); break; @@ -757,19 +751,6 @@ package org.bigbluebutton.modules.users.services } } - private function handleInactivityWarning(msg:Object):void { - var body:Object = msg.body as Object; - - var bbbEvent:BBBEvent = new BBBEvent(BBBEvent.INACTIVITY_WARNING_EVENT); - bbbEvent.payload.duration = body.timeLeftInSec as Number; - globalDispatcher.dispatchEvent(bbbEvent); - } - - private function handleMeetingIsActive(msg:Object):void { - var bbbEvent:BBBEvent = new BBBEvent(BBBEvent.MEETING_IS_ACTIVE_EVENT); - globalDispatcher.dispatchEvent(bbbEvent); - } - private function handleGetRecordingStatusReply(msg: Object):void { var body:Object = msg.body as Object; var recording: Boolean = body.recording as Boolean; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as index 8a4b6323913d8b8c1d916a0d63dbf87c6c888e20..ba686e139a997ced16d7d82aaa6d9381b94317c4 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageSender.as @@ -306,27 +306,6 @@ package org.bigbluebutton.modules.users.services }, message); } - public function activityResponse():void { - var message:Object = { - header: {name: "MeetingActivityResponseCmdMsg", meetingId: UsersUtil.getInternalMeetingID(), - userId: UsersUtil.getMyUserID()}, - body: {respondedBy: UsersUtil.getMyUserID()} - }; - - var _nc:ConnectionManager = BBB.initConnectionManager(); - _nc.sendMessage2x( - function(result:String):void { // On successful result - }, - function(status:String):void { // status - On error occurred - var logData:Object = UsersUtil.initLogData(); - logData.tags = ["apps"]; - logData.logCode = "error_sending_meeting_activity_response"; - LOGGER.info(JSON.stringify(logData)); - }, - message - ); //_netConnection.call - } - public function userActivitySignResponse():void { var message:Object = { header: {name: "UserActivitySignCmdMsg", meetingId: UsersUtil.getInternalMeetingID(), diff --git a/bigbluebutton-config/bin/bbb-conf b/bigbluebutton-config/bin/bbb-conf index 40b4afd7bd5fe0d3d6fe5baa38942859e874354a..09a8c49ad8ef803bb1e543221907fa245993a8f7 100755 --- a/bigbluebutton-config/bin/bbb-conf +++ b/bigbluebutton-config/bin/bbb-conf @@ -446,7 +446,7 @@ start_bigbluebutton () { } display_bigbluebutton_status () { - units="nginx freeswitch $REDIS_SERVICE bbb-apps-akka bbb-transcode-akka bbb-fsesl-akka" + units="nginx freeswitch $REDIS_SERVICE bbb-apps-akka bbb-fsesl-akka" if [ -f /usr/share/red5/red5-server.jar ]; then units="$units red5" diff --git a/bigbluebutton-config/bin/bbb-record b/bigbluebutton-config/bin/bbb-record index 6cf80ea5bf8bccb561cdd26d32dc2a45c7a43a70..0a2aa60001c042b865b207f15430dc0213fad73c 100755 --- a/bigbluebutton-config/bin/bbb-record +++ b/bigbluebutton-config/bin/bbb-record @@ -388,6 +388,7 @@ if [ $DELETE ]; then rm -rf /usr/share/red5/webapps/video-broadcast/streams/$MEETING_ID rm -f /var/bigbluebutton/screenshare/$MEETING_ID*.flv rm -f /var/freeswitch/meetings/$MEETING_ID*.wav + rm -f /var/freeswitch/meetings/$MEETING_ID*.opus rm -rf /var/bigbluebutton/$MEETING_ID fi @@ -419,6 +420,7 @@ if [ $DELETEALL ]; then find /usr/share/red5/webapps/video-broadcast/streams -name "*.flv" -exec rm '{}' \; rm -f /var/bigbluebutton/screenshare/*.flv rm -f /var/freeswitch/meetings/*.wav + rm -f /var/freeswitch/meetings/*.opus for meeting in $(ls /var/bigbluebutton | grep "^[0-9a-f]\{40\}-[[:digit:]]\{13\}$"); do echo "deleting: $meeting" diff --git a/bigbluebutton-html5/imports/api/annotations/addAnnotation.js b/bigbluebutton-html5/imports/api/annotations/addAnnotation.js index 1f1a07dda4b77682535da8582e87dc9b28b16f49..90435ccccbd4d80eb80f7ce7c0bcfa00c4ab7fd4 100755 --- a/bigbluebutton-html5/imports/api/annotations/addAnnotation.js +++ b/bigbluebutton-html5/imports/api/annotations/addAnnotation.js @@ -41,8 +41,10 @@ function handleTextUpdate(meetingId, whiteboardId, userId, annotation) { id, status, annotationType, annotationInfo, wbId, position, } = annotation; - const { textBoxWidth, textBoxHeight } = annotationInfo; - const useDefaultSize = textBoxWidth === 0 && textBoxHeight === 0; + const { textBoxWidth, textBoxHeight, calcedFontSize } = annotationInfo; + const useDefaultSize = (textBoxWidth === 0 && textBoxHeight === 0) + || textBoxWidth < calcedFontSize + || textBoxHeight < calcedFontSize; if (useDefaultSize) { annotationInfo.textBoxWidth = DEFAULT_TEXT_WIDTH; diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js index 7f15e961f29f8ed9e213b22aedb5296603d7dc15..4dce903de39c43adc4500275f40f8e11b9bb34d1 100755 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js @@ -42,8 +42,6 @@ export default function addMeeting(meeting) { createdTime: Number, duration: Number, createdDate: String, - maxInactivityTimeoutMinutes: Number, - warnMinutesBeforeMax: Number, meetingExpireIfNoUserJoinedInMinutes: Number, meetingExpireWhenLastUserLeftInMinutes: Number, userInactivityInspectTimerInMinutes: Number, diff --git a/bigbluebutton-html5/imports/api/users-settings/server/methods/addUserSettings.js b/bigbluebutton-html5/imports/api/users-settings/server/methods/addUserSettings.js index 04217b08ea56a7d5cb5535db45ac45adffe1d4d9..23b6f390bd9dcd44c7c733c606c98a9e2cba3ed6 100644 --- a/bigbluebutton-html5/imports/api/users-settings/server/methods/addUserSettings.js +++ b/bigbluebutton-html5/imports/api/users-settings/server/methods/addUserSettings.js @@ -45,6 +45,7 @@ const currentParameters = [ 'bbb_preferred_camera_profile', 'bbb_enable_screen_sharing', 'bbb_enable_video', + 'bbb_record_video', 'bbb_skip_video_preview', 'bbb_mirror_own_webcam', // PRESENTATION diff --git a/bigbluebutton-html5/imports/startup/client/intl.jsx b/bigbluebutton-html5/imports/startup/client/intl.jsx index 91e74e61259d88f9ddd5fb25412419f52c9d58ac..126cabf21f2ca1f1634e3c5d46f607e9815c873f 100644 --- a/bigbluebutton-html5/imports/startup/client/intl.jsx +++ b/bigbluebutton-html5/imports/startup/client/intl.jsx @@ -110,7 +110,7 @@ const propTypes = { children: PropTypes.element.isRequired, }; -const DEFAULT_LANGUAGE = Meteor.settings.public.app.defaultSettings.application.locale; +const DEFAULT_LANGUAGE = Meteor.settings.public.app.defaultSettings.application.fallbackLocale; const RTL_LANGUAGES = ['ar', 'he', 'fa']; @@ -119,13 +119,26 @@ const defaultProps = { }; class IntlStartup extends Component { + static saveLocale(localeName) { + Settings.application.locale = localeName; + if (RTL_LANGUAGES.includes(localeName.substring(0, 2))) { + document.body.parentNode.setAttribute('dir', 'rtl'); + Settings.application.isRTL = true; + } else { + document.body.parentNode.setAttribute('dir', 'ltr'); + Settings.application.isRTL = false; + } + Settings.save(); + } + constructor(props) { super(props); this.state = { messages: {}, normalizedLocale: null, - fetching: false, + fetching: true, + localeChanged: false, }; if (RTL_LANGUAGES.includes(props.locale)) { @@ -135,18 +148,23 @@ class IntlStartup extends Component { this.fetchLocalizedMessages = this.fetchLocalizedMessages.bind(this); } - componentWillMount() { + componentDidMount() { const { locale } = this.props; this.fetchLocalizedMessages(locale, true); } - componentWillUpdate(nextProps) { - const { fetching, normalizedLocale } = this.state; - const { locale } = nextProps; - + componentDidUpdate(prevProps) { + const { fetching, normalizedLocale, localeChanged } = this.state; + const { locale } = this.props; + if (prevProps.locale !== locale) { + this.setState({ + localeChanged: true, + }); + } if (!fetching && normalizedLocale - && locale.toLowerCase() !== normalizedLocale.toLowerCase()) { + && ((locale.toLowerCase() !== normalizedLocale.toLowerCase()))) { + if (((DEFAULT_LANGUAGE === normalizedLocale.toLowerCase()) && !localeChanged)) return; this.fetchLocalizedMessages(locale); } } @@ -166,34 +184,23 @@ class IntlStartup extends Component { .then(({ messages, normalizedLocale }) => { const dasherizedLocale = normalizedLocale.replace('_', '-'); this.setState({ messages, fetching: false, normalizedLocale: dasherizedLocale }, () => { - this.saveLocale(dasherizedLocale); + IntlStartup.saveLocale(dasherizedLocale); }); }) .catch(() => { this.setState({ fetching: false, normalizedLocale: null }, () => { - this.saveLocale(DEFAULT_LANGUAGE); + IntlStartup.saveLocale(DEFAULT_LANGUAGE); }); }); }); } - saveLocale(localeName) { - Settings.application.locale = localeName; - if (RTL_LANGUAGES.includes(localeName.substring(0, 2))) { - document.body.parentNode.setAttribute('dir', 'rtl'); - Settings.application.isRTL = true; - } else { - document.body.parentNode.setAttribute('dir', 'ltr'); - Settings.application.isRTL = false; - } - Settings.save(); - } render() { const { fetching, normalizedLocale, messages } = this.state; const { children } = this.props; - return fetching ? <LoadingScreen /> : ( + return (fetching || !normalizedLocale) ? <LoadingScreen /> : ( <IntlProvider locale={normalizedLocale} messages={messages}> {children} </IntlProvider> diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx index 1fe1f16c0d4d10878f130e275aa76626184c3f78..ae492b42e4277e2c76a72542a15330bf785a927f 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx @@ -91,9 +91,9 @@ class ActionsDropdown extends PureComponent { this.makePresentationItems = this.makePresentationItems.bind(this); } - componentWillUpdate(nextProps) { - const { amIPresenter: isPresenter } = nextProps; - const { amIPresenter: wasPresenter, mountModal } = this.props; + componentDidUpdate(prevProps) { + const { amIPresenter: wasPresenter } = prevProps; + const { amIPresenter: isPresenter, mountModal } = this.props; if (wasPresenter && !isPresenter) { mountModal(null); } diff --git a/bigbluebutton-html5/imports/ui/components/captions/pad/styles.scss b/bigbluebutton-html5/imports/ui/components/captions/pad/styles.scss index c2efa73b7ef2087f407c8225dffc8903402d4a51..a4f25982cf64ba0e9c3efa6dc06fe6a9aa0dd353 100644 --- a/bigbluebutton-html5/imports/ui/components/captions/pad/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/captions/pad/styles.scss @@ -20,34 +20,35 @@ .pad { background-color: var(--color-white); - padding: var(--md-padding-x); + padding: + var(--md-padding-x) + var(--md-padding-y) + var(--md-padding-x) + var(--md-padding-x); + display: flex; flex-grow: 1; flex-direction: column; justify-content: space-around; overflow: hidden; height: 100vh; - transform: translateZ(0); + + :global(.browser-chrome) & { + transform: translateZ(0); + } + + @include mq($small-only) { + transform: none !important; + } } .header { + position: relative; + top: var(--poll-header-offset); display: flex; flex-direction: row; - align-items: left; - flex-shrink: 0; - - a { - @include elementFocus(var(--color-primary)); - padding-bottom: var(--sm-padding-y); - padding-left: var(--sm-padding-y); - text-decoration: none; - display: block; - } - - [class^="icon-bbb-"], - [class*=" icon-bbb-"] { - font-size: 85%; - } + align-items: center; + justify-content: space-between; } .title { @@ -55,9 +56,7 @@ flex: 1; & > button, button:hover { - margin-top: 0; - padding-top: 0; - border-top: 0; + max-width: var(--toast-content-width); } } @@ -65,12 +64,27 @@ position: relative; background-color: var(--color-white); display: block; - margin: 4px; - margin-bottom: 2px; - padding-left: 0px; + margin: var(--border-size-large); + margin-bottom: var(--border-size); + padding-left: 0; + padding-right: inherit; + + [dir="rtl"] & { + padding-left: inherit; + padding-right: 0; + } > i { - color: black; + color: var(--color-gray-dark); + font-size: smaller; + + [dir="rtl"] & { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); + } } &:hover { diff --git a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx index c3188b8776082ce0be5581717835d84917455b82..dd275989d618916a9774e0c5c41a7a67943385f7 100755 --- a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx @@ -72,7 +72,7 @@ class ChatDropdown extends PureComponent { getAvailableActions() { const { - intl, isMeteorConnected, amIModerator, meetingName, + intl, isMeteorConnected, amIModerator, meetingIsBreakout, meetingName, } = this.props; const clearIcon = 'delete'; @@ -108,7 +108,7 @@ class ChatDropdown extends PureComponent { label={intl.formatMessage(intlMessages.copy)} key={this.actionsKey[1]} />, - amIModerator && isMeteorConnected ? ( + !meetingIsBreakout && amIModerator && isMeteorConnected ? ( <DropdownListItem data-test="chatClear" icon={clearIcon} diff --git a/bigbluebutton-html5/imports/ui/components/chat/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/component.jsx index 05654954fbaf54b4c144640963d67ce7f91d5968..534bc851e55021b717f01c1f690a80bbe7648f70 100755 --- a/bigbluebutton-html5/imports/ui/components/chat/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/component.jsx @@ -41,6 +41,7 @@ const Chat = (props) => { minMessageLength, maxMessageLength, amIModerator, + meetingIsBreakout, } = props; const HIDE_CHAT_AK = shortcuts.hidePrivateChat; @@ -89,12 +90,7 @@ const Chat = (props) => { accessKey={CLOSE_CHAT_AK} /> ) - : ( - <ChatDropdownContainer - isMeteorConnected={isMeteorConnected} - amIModerator={amIModerator} - /> - ) + : <ChatDropdownContainer {...{ meetingIsBreakout, isMeteorConnected, amIModerator }} /> } </header> <MessageList diff --git a/bigbluebutton-html5/imports/ui/components/chat/container.jsx b/bigbluebutton-html5/imports/ui/components/chat/container.jsx index 5ba32ed22a049695388087aa476130ba3e2b20d5..c471538140409fbb9b92e04c094d674da6c47ab0 100755 --- a/bigbluebutton-html5/imports/ui/components/chat/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/container.jsx @@ -3,9 +3,10 @@ import { defineMessages, injectIntl } from 'react-intl'; import { withTracker } from 'meteor/react-meteor-data'; import { Session } from 'meteor/session'; import Auth from '/imports/ui/services/auth'; +import Storage from '/imports/ui/services/storage/session'; +import { meetingIsBreakout } from '/imports/ui/components/app/service'; import Chat from './component'; import ChatService from './service'; -import Storage from '/imports/ui/services/storage/session'; const CHAT_CONFIG = Meteor.settings.public.chat; const PUBLIC_CHAT_KEY = CHAT_CONFIG.public_id; @@ -176,6 +177,7 @@ export default injectIntl(withTracker(({ intl }) => { isChatLocked, isMeteorConnected, amIModerator, + meetingIsBreakout: meetingIsBreakout(), actions: { handleClosePrivateChat: ChatService.closePrivateChat, }, diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/component.jsx index 23bf500e1cd8513d87873dc554369fa61454c131..e33714ce5370030370690383e2a54b9b051271e3 100644 --- a/bigbluebutton-html5/imports/ui/components/dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/component.jsx @@ -85,10 +85,6 @@ class Dropdown extends Component { this.handleWindowClick = this.handleWindowClick.bind(this); } - componentWillUpdate(nextProps, nextState) { - return nextState.isOpen ? screenreaderTrap.trap(this.dropdown) : screenreaderTrap.untrap(); - } - componentDidUpdate(prevProps, prevState) { const { onShow, @@ -98,6 +94,11 @@ class Dropdown extends Component { const { isOpen } = this.state; + if (isOpen) { + screenreaderTrap.trap(this.dropdown); + } else { + screenreaderTrap.untrap(); + } if (isOpen && !prevState.isOpen) { onShow(); } @@ -203,7 +204,7 @@ class Dropdown extends Component { dropdownToggle: this.handleToggle, dropdownShow: this.handleShow, dropdownHide: this.handleHide, - keepOpen, + keepopen: `${keepOpen}`, }); content = React.cloneElement(content, { @@ -216,7 +217,7 @@ class Dropdown extends Component { dropdownToggle: this.handleToggle, dropdownShow: this.handleShow, dropdownHide: this.handleHide, - keepOpen, + keepopen: `${keepOpen}`, }); const showCloseBtn = (isOpen && keepOpen) || (isOpen && keepOpen === null); diff --git a/bigbluebutton-html5/imports/ui/components/external-video-player/custom-players/panopto.jsx b/bigbluebutton-html5/imports/ui/components/external-video-player/custom-players/panopto.jsx index b1305869af22da14413b0b126c7ac9077195233a..d7a886631b25c794c995bf31c125a48e9fbaf911 100644 --- a/bigbluebutton-html5/imports/ui/components/external-video-player/custom-players/panopto.jsx +++ b/bigbluebutton-html5/imports/ui/components/external-video-player/custom-players/panopto.jsx @@ -1,4 +1,4 @@ -const MATCH_URL = /https?\:\/\/(([a-zA-Z]+\.)?([a-zA-Z]+\.panopto\.[a-zA-Z]+\/Panopto))\/Pages\/Viewer\.aspx\?id=([-a-zA-Z0-9]+)/; +const MATCH_URL = /https?\:\/\/([^\/]+\/Panopto)(\/Pages\/Viewer\.aspx\?id=)([-a-zA-Z0-9]+)/; export class Panopto { @@ -8,7 +8,7 @@ export class Panopto { static getSocialUrl(url) { const m = url.match(MATCH_URL); - return 'https://' + m[1] + '/Podcast/Social/' + m[4] + '.mp4'; + return 'https://' + m[1] + '/Podcast/Social/' + m[3] + '.mp4'; } } diff --git a/bigbluebutton-html5/imports/ui/components/media/container.jsx b/bigbluebutton-html5/imports/ui/components/media/container.jsx index 126be95b43198dad2b25eed24384fbc9c318fdf6..010f15b0f3a04dcfcdc6180cd03902593bd0753a 100755 --- a/bigbluebutton-html5/imports/ui/components/media/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/container.jsx @@ -123,7 +123,7 @@ export default withLayoutConsumer(withModalMounter(withTracker(() => { data.children = <ScreenshareContainer />; } - const usersVideo = VideoService.getVideoStreams(); + const { streams: usersVideo } = VideoService.getVideoStreams(); data.usersVideo = usersVideo; if (MediaService.shouldShowOverlay() && usersVideo.length && viewParticipantsWebcams) { diff --git a/bigbluebutton-html5/imports/ui/components/note/styles.scss b/bigbluebutton-html5/imports/ui/components/note/styles.scss index a230da9643fa95ff870a068f7ec69b62b6ad1482..477958f96edba32e22b3adea0ba6f197cd1c250c 100644 --- a/bigbluebutton-html5/imports/ui/components/note/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/note/styles.scss @@ -3,37 +3,35 @@ .note { background-color: var(--color-white); - padding: var(--md-padding-x); + padding: + var(--md-padding-x) + var(--md-padding-y) + var(--md-padding-x) + var(--md-padding-x); + display: flex; flex-grow: 1; flex-direction: column; justify-content: space-around; overflow: hidden; height: 100vh; - transform: translateZ(0); + + :global(.browser-chrome) & { + transform: translateZ(0); + } + + @include mq($small-only) { + transform: none !important; + } } .header { + position: relative; + top: var(--poll-header-offset); display: flex; flex-direction: row; - align-items: left; - flex-shrink: 0; - - a { - @include elementFocus(var(--color-primary)); - padding: 0 0 var(--sm-padding-y) var(--sm-padding-y); - text-decoration: none; - display: block; - - [dir="rtl"] & { - padding: 0 var(--sm-padding-y) var(--sm-padding-y) 0; - } - } - - [class^="icon-bbb-"], - [class*=" icon-bbb-"] { - font-size: 85%; - } + align-items: center; + justify-content: space-between; } .title { @@ -41,9 +39,7 @@ flex: 1; & > button, button:hover { - margin-top: 0; - padding-top: 0; - border-top: 0; + max-width: var(--toast-content-width); } } @@ -51,16 +47,27 @@ position: relative; background-color: var(--color-white); display: block; - margin: 4px; - margin-bottom: 2px; - padding: inherit inherit inherit 0; + margin: var(--border-size-large); + margin-bottom: var(--border-size); + padding-left: 0; + padding-right: inherit; [dir="rtl"] & { - padding: inherit 0 inherit inherit; + padding-left: inherit; + padding-right: 0; } > i { - color: black; + color: var(--color-gray-dark); + font-size: smaller; + + [dir="rtl"] & { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); + } } &:hover { diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 64aededfcdfe0648dfd95617c5891c835313e936..a72723dffe71159aca76fd26126697843da1996d 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -31,8 +31,20 @@ const intlMessages = defineMessages({ description: 'label displayed in toast when presentation switches', }, downloadLabel: { - id: 'app.presentation.downloadLabel', - description: 'label for downloadable presentations', + id: 'app.presentation.downloadLabel', + description: 'label for downloadable presentations', + }, + slideContentStart: { + id: 'app.presentation.startSlideContent', + description: 'Indicate the slide content start', + }, + slideContentEnd: { + id: 'app.presentation.endSlideContent', + description: 'Indicate the slide content end', + }, + noSlideContent: { + id: 'app.presentation.emptySlideContent', + description: 'No content available for slide', }, }); @@ -494,6 +506,7 @@ class PresentationArea extends PureComponent { // renders the whole presentation area renderPresentationArea(svgDimensions, viewBoxDimensions) { const { + intl, podId, currentSlide, slidePosition, @@ -517,6 +530,7 @@ class PresentationArea extends PureComponent { const { imageUri, + content, } = currentSlide; let viewBoxPosition; @@ -544,6 +558,10 @@ class PresentationArea extends PureComponent { const svgViewBox = `${viewBoxPosition.x} ${viewBoxPosition.y} ` + `${viewBoxDimensions.width} ${Number.isNaN(viewBoxDimensions.height) ? 0 : viewBoxDimensions.height}`; + const slideContent = content ? `${intl.formatMessage(intlMessages.slideContentStart)} + ${content} + ${intl.formatMessage(intlMessages.slideContentEnd)}` : intl.formatMessage(intlMessages.noSlideContent); + return ( <div style={{ @@ -554,6 +572,7 @@ class PresentationArea extends PureComponent { display: layoutSwapped ? 'none' : 'block', }} > + <span id="currentSlideText" className={styles.visuallyHidden}>{slideContent}</span> {this.renderPresentationClose()} {this.renderPresentationDownload()} {this.renderPresentationFullscreen()} diff --git a/bigbluebutton-html5/imports/ui/components/presentation/container.jsx b/bigbluebutton-html5/imports/ui/components/presentation/container.jsx index d69440a982e36905c05a3514cbee2879b006b9a8..398d14e8a2b19472568ca66a25c76d7529801060 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/container.jsx @@ -3,6 +3,7 @@ import { withTracker } from 'meteor/react-meteor-data'; import MediaService, { getSwapLayout, shouldEnableSwapLayout } from '/imports/ui/components/media/service'; import { notify } from '/imports/ui/services/notification'; import PresentationAreaService from './service'; +import { Slides } from '/imports/api/slides'; import PresentationArea from './component'; import PresentationToolbarService from './presentation-toolbar/service'; import Auth from '/imports/ui/services/auth'; @@ -16,6 +17,10 @@ const PresentationAreaContainer = ({ presentationPodIds, mountPresentationArea, mountPresentationArea && <PresentationArea {...props} /> ); +const APP_CONFIG = Meteor.settings.public.app; +const PRELOAD_NEXT_SLIDE = APP_CONFIG.preloadNextSlides; +const fetchedpresentation = {}; + export default withTracker(({ podId }) => { const currentSlide = PresentationAreaService.getCurrentSlide(podId); const presentationIsDownloadable = PresentationAreaService.isPresentationDownloadable(podId); @@ -33,6 +38,35 @@ export default withTracker(({ podId }) => { id: slideId, } = currentSlide; slidePosition = PresentationAreaService.getSlidePosition(podId, presentationId, slideId); + if (PRELOAD_NEXT_SLIDE && !fetchedpresentation[presentationId]) { + fetchedpresentation[presentationId] = { + canFetch: true, + fetchedSlide: {}, + }; + } + const currentSlideNum = currentSlide.num; + const presentation = fetchedpresentation[presentationId]; + + if (PRELOAD_NEXT_SLIDE && !presentation.fetchedSlide[currentSlide.num + PRELOAD_NEXT_SLIDE] && presentation.canFetch) { + const slidesToFetch = Slides.find({ + podId, + presentationId, + num: { + $in: Array(PRELOAD_NEXT_SLIDE).fill(1).map((v, idx) => currentSlideNum + (idx + 1)), + }, + }).fetch(); + + const promiseImageGet = slidesToFetch + .filter(s => !fetchedpresentation[presentationId].fetchedSlide[s.num]) + .map(async (slide) => { + if (presentation.canFetch) presentation.canFetch = false; + const image = await fetch(slide.imageUri); + if (image.ok) { + presentation.fetchedSlide[slide.num] = true; + } + }); + Promise.all(promiseImageGet).then(() => presentation.canFetch = true); + } } return { currentSlide, diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx index a784bdfcb5bdfcd28b0d67dc73ae700b6a7e38af..2fb6ef37ec1029c1f6a629fc4af2bf0beba875e7 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-dropdown/component.jsx @@ -163,9 +163,7 @@ class UserDropdown extends PureComponent { this.renderUserAvatar = this.renderUserAvatar.bind(this); this.resetMenuState = this.resetMenuState.bind(this); this.makeDropdownItem = this.makeDropdownItem.bind(this); - } - componentWillMount() { this.title = _.uniqueId('dropdown-title-'); this.seperator = _.uniqueId('action-separator-'); } @@ -344,7 +342,7 @@ class UserDropdown extends PureComponent { )); } - if (allowedToMuteAudio && isMeteorConnected) { + if (allowedToMuteAudio && isMeteorConnected && !meetingIsBreakout) { actions.push(this.makeDropdownItem( 'mute', intl.formatMessage(messages.MuteUserAudioLabel), @@ -353,7 +351,7 @@ class UserDropdown extends PureComponent { )); } - if (allowedToUnmuteAudio && !userLocks.userMic && isMeteorConnected) { + if (allowedToUnmuteAudio && !userLocks.userMic && isMeteorConnected && !meetingIsBreakout) { actions.push(this.makeDropdownItem( 'unmute', intl.formatMessage(messages.UnmuteUserAudioLabel), diff --git a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx index 2e1b7528cc1c231e9dda03e0c908a2b4592f65fa..5a9b322f615b7c23df2048984dc11887e226a4e4 100755 --- a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx @@ -62,6 +62,22 @@ const intlMessages = defineMessages({ id: 'app.videoPreview.profileLabel', description: 'Quality dropdown label', }, + low: { + id: 'app.videoPreview.quality.low', + description: 'Low quality option label', + }, + medium: { + id: 'app.videoPreview.quality.medium', + description: 'Medium quality option label', + }, + high: { + id: 'app.videoPreview.quality.high', + description: 'High quality option label', + }, + hd: { + id: 'app.videoPreview.quality.hd', + description: 'High definition option label', + }, cancelLabel: { id: 'app.videoPreview.cancelLabel', description: 'Cancel button label', @@ -540,11 +556,16 @@ class VideoPreview extends Component { onChange={this.handleSelectProfile} disabled={skipVideoPreview} > - {availableProfiles.map(profile => ( + {availableProfiles.map(profile => { + const label = intlMessages[`${profile.id}`] + ? intl.formatMessage(intlMessages[`${profile.id}`]) + : profile.name; + + return ( <option key={profile.id} value={profile.id}> - {profile.name} + {`${label} ${profile.id === 'hd' ? '' : intl.formatMessage(intlMessages.qualityLabel).toLowerCase()}`} </option> - ))} + )})} </select> ) : ( diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx index 3254518864a859b2d3cac22cb92a9014ae7fcc24..e0b13ad120088b3359b2aa28370f678e89b14732 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/component.jsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReconnectingWebSocket from 'reconnecting-websocket'; import VideoService from './service'; -import VideoList from './video-list/component'; +import VideoListContainer from './video-list/container'; import { defineMessages, injectIntl } from 'react-intl'; import { fetchWebRTCMappedStunTurnServers, @@ -10,6 +10,7 @@ import { } from '/imports/utils/fetchStunTurnServers'; import { tryGenerateIceCandidates } from '/imports/utils/safari-webrtc'; import logger from '/imports/startup/client/logger'; +import _ from 'lodash'; // Default values and default empty object to be backwards compat with 2.2. // FIXME Remove hardcoded defaults 2.3. @@ -81,6 +82,7 @@ const propTypes = { intl: PropTypes.objectOf(Object).isRequired, isUserLocked: PropTypes.bool.isRequired, swapLayout: PropTypes.bool.isRequired, + currentVideoPageIndex: PropTypes.number.isRequired, }; class VideoProvider extends Component { @@ -117,6 +119,11 @@ class VideoProvider extends Component { this.onWsMessage = this.onWsMessage.bind(this); this.updateStreams = this.updateStreams.bind(this); + this.debouncedConnectStreams = _.debounce( + this.connectStreams, + VideoService.getPageChangeDebounceTime(), + { leading: false, trailing: true, } + ); } componentDidMount() { @@ -132,9 +139,13 @@ class VideoProvider extends Component { } componentDidUpdate(prevProps) { - const { isUserLocked, streams } = this.props; + const { isUserLocked, streams, currentVideoPageIndex } = this.props; + + // Only debounce when page changes to avoid unecessary debouncing + const shouldDebounce = VideoService.isPaginationEnabled() + && prevProps.currentVideoPageIndex !== currentVideoPageIndex; - this.updateStreams(streams); + this.updateStreams(streams, shouldDebounce); if (!prevProps.isUserLocked && isUserLocked) VideoService.lockUser(); } @@ -231,7 +242,7 @@ class VideoProvider extends Component { } } - updateStreams(streams) { + getStreamsToConnectAndDisconnect(streams) { const streamsCameraIds = streams.map(s => s.cameraId); const streamsConnected = Object.keys(this.webRtcPeers); @@ -243,15 +254,33 @@ class VideoProvider extends Component { cameraId => !streamsCameraIds.includes(cameraId), ); + return [streamsToConnect, streamsToDisconnect]; + } + + connectStreams(streamsToConnect) { streamsToConnect.forEach((cameraId) => { const isLocal = VideoService.isLocalStream(cameraId); this.createWebRTCPeer(cameraId, isLocal); }); + } + disconnectStreams(streamsToDisconnect) { streamsToDisconnect.forEach(cameraId => this.stopWebRTCPeer(cameraId)); + } + + updateStreams(streams, shouldDebounce = false) { + const [streamsToConnect, streamsToDisconnect] = this.getStreamsToConnectAndDisconnect(streams); + + if(shouldDebounce) { + this.debouncedConnectStreams(streamsToConnect); + } else { + this.connectStreams(streamsToConnect); + } + + this.disconnectStreams(streamsToDisconnect); if (CAMERA_QUALITY_THRESHOLDS_ENABLED) { - this.updateThreshold(streamsCameraIds.length); + this.updateThreshold(this.props.totalNumberOfStreams); } } @@ -519,6 +548,7 @@ class VideoProvider extends Component { userId: this.info.userId, userName: this.info.userName, bitrate, + record: VideoService.getRecord(), }; logger.info({ @@ -849,7 +879,7 @@ class VideoProvider extends Component { } render() { - const { swapLayout } = this.props; + const { swapLayout, currentVideoPageIndex } = this.props; const { socketOpen } = this.state; if (!socketOpen) return null; @@ -857,10 +887,11 @@ class VideoProvider extends Component { streams, } = this.props; return ( - <VideoList + <VideoListContainer streams={streams} onMount={this.createVideoTag} swapLayout={swapLayout} + currentVideoPageIndex={currentVideoPageIndex} /> ); } diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/container.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/container.jsx index 214027c24aa8c72088035cb2ccefe490efeb5f68..338eb21bb1b9df7d212fe45cff4ed3a3d923bf8f 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/container.jsx @@ -9,8 +9,22 @@ const VideoProviderContainer = ({ children, ...props }) => { return (!streams.length ? null : <VideoProvider {...props}>{children}</VideoProvider>); }; -export default withTracker(props => ({ - swapLayout: props.swapLayout, - streams: VideoService.getVideoStreams(), - isUserLocked: VideoService.isUserLocked(), -}))(withLayoutContext(VideoProviderContainer)); +export default withTracker(props => { + // getVideoStreams returns a dictionary consisting of: + // { + // streams: array of mapped streams + // totalNumberOfStreams: total number of shared streams in the server + // } + const { + streams, + totalNumberOfStreams + } = VideoService.getVideoStreams(); + + return { + swapLayout: props.swapLayout, + streams, + totalNumberOfStreams, + isUserLocked: VideoService.isUserLocked(), + currentVideoPageIndex: VideoService.getCurrentVideoPageIndex(), + }; +})( withLayoutContext(VideoProviderContainer)); diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/service.js b/bigbluebutton-html5/imports/ui/components/video-provider/service.js index 395b9f9d9fefa0e867b1dfce7d82121b13c2e1af..0890a389683699b08f3e9ffccebc3ebcc1252de7 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/service.js +++ b/bigbluebutton-html5/imports/ui/components/video-provider/service.js @@ -12,6 +12,7 @@ import { monitorVideoConnection } from '/imports/utils/stats'; import browser from 'browser-detect'; import getFromUserSettings from '/imports/ui/services/users-settings'; import logger from '/imports/startup/client/logger'; +import _ from 'lodash'; const CAMERA_PROFILES = Meteor.settings.public.kurento.cameraProfiles; const MULTIPLE_CAMERAS = Meteor.settings.public.app.enableMultipleCameras; @@ -23,23 +24,61 @@ const ROLE_VIEWER = Meteor.settings.public.user.role_viewer; const ENABLE_NETWORK_MONITORING = Meteor.settings.public.networkMonitoring.enableNetworkMonitoring; const MIRROR_WEBCAM = Meteor.settings.public.app.mirrorOwnWebcam; const CAMERA_QUALITY_THRESHOLDS = Meteor.settings.public.kurento.cameraQualityThresholds.thresholds || []; +const { + enabled: PAGINATION_ENABLED, + pageChangeDebounceTime: PAGE_CHANGE_DEBOUNCE_TIME, + desktopPageSizes: DESKTOP_PAGE_SIZES, + mobilePageSizes: MOBILE_PAGE_SIZES, +} = Meteor.settings.public.kurento.pagination; const TOKEN = '_'; class VideoService { + static isUserPresenter(userId) { + const user = Users.findOne({ userId }, + { fields: { presenter: 1 } }); + return user ? user.presenter : false; + } + + // Paginated streams: sort with following priority: local -> presenter -> alphabetic + static sortPaginatedStreams(s1, s2) { + if (VideoService.isUserPresenter(s1.userId) && !VideoService.isUserPresenter(s2.userId)) { + return -1; + } else if (VideoService.isUserPresenter(s2.userId) && !VideoService.isUserPresenter(s1.userId)) { + return 1; + } else { + return UserListService.sortUsersByName(s1, s2); + } + } + + // Full mesh: sort with the following priority: local -> alphabetic + static sortMeshStreams(s1, s2) { + if (s1.userId === Auth.userID) { + return -1; + } else { + return UserListService.sortUsersByName(s1, s2); + } + } + constructor() { this.defineProperties({ isConnecting: false, isConnected: false, + currentVideoPageIndex: 0, + numberOfPages: 0, }); this.skipVideoPreview = null; this.userParameterProfile = null; const BROWSER_RESULTS = browser(); this.isMobile = BROWSER_RESULTS.mobile || BROWSER_RESULTS.os.includes('Android'); this.isSafari = BROWSER_RESULTS.name === 'safari'; + this.pageChangeLocked = false; this.numberOfDevices = 0; + this.record = null; + this.hackRecordViewer = null; + // If the page isn't served over HTTPS there won't be mediaDevices if (navigator.mediaDevices) { this.updateNumberOfDevices = this.updateNumberOfDevices.bind(this); @@ -163,6 +202,103 @@ class VideoService { return Auth.authenticateURL(SFU_URL); } + isPaginationEnabled () { + return PAGINATION_ENABLED && (this.getMyPageSize() > 0); + } + + setNumberOfPages (numberOfPublishers, numberOfSubscribers, pageSize) { + // Page size 0 means no pagination, return itself + if (pageSize === 0) return 0; + + // Page size refers only to the number of subscribers. Publishers are always + // shown, hence not accounted for + const nofPages = Math.ceil((numberOfSubscribers || numberOfPublishers) / pageSize); + + if (nofPages !== this.numberOfPages) { + this.numberOfPages = nofPages; + // Check if we have to page back on the current video page index due to a + // page ceasing to exist + if ((this.currentVideoPageIndex + 1) > this.numberOfPages) { + this.getPreviousVideoPage(); + } + } + + return this.numberOfPages; + } + + getNumberOfPages () { + return this.numberOfPages; + } + + setCurrentVideoPageIndex (newVideoPageIndex) { + if (this.currentVideoPageIndex !== newVideoPageIndex) { + this.currentVideoPageIndex = newVideoPageIndex; + } + } + + getCurrentVideoPageIndex () { + return this.currentVideoPageIndex; + } + + calculateNextPage () { + if (this.numberOfPages === 0) { + return 0; + } + + return ((this.currentVideoPageIndex + 1) % this.numberOfPages + this.numberOfPages) % this.numberOfPages; + } + + calculatePreviousPage () { + if (this.numberOfPages === 0) { + return 0; + } + + return ((this.currentVideoPageIndex - 1) % this.numberOfPages + this.numberOfPages) % this.numberOfPages; + } + + getNextVideoPage() { + const nextPage = this.calculateNextPage(); + this.setCurrentVideoPageIndex(nextPage); + + return this.currentVideoPageIndex; + } + + getPreviousVideoPage() { + const previousPage = this.calculatePreviousPage(); + this.setCurrentVideoPageIndex(previousPage); + + return this.currentVideoPageIndex; + } + + getMyPageSize () { + const myRole = this.getMyRole(); + const pageSizes = !this.isMobile ? DESKTOP_PAGE_SIZES : MOBILE_PAGE_SIZES; + + switch (myRole) { + case ROLE_MODERATOR: + return pageSizes.moderator; + case ROLE_VIEWER: + default: + return pageSizes.viewer + } + } + + getVideoPage (streams, pageSize) { + // Publishers are taken into account for the page size calculations. They + // also appear on every page. + const [mine, others] = _.partition(streams, (vs => { return Auth.userID === vs.userId; })); + + // Recalculate total number of pages + this.setNumberOfPages(mine.length, others.length, pageSize); + const chunkIndex = this.currentVideoPageIndex * pageSize; + const paginatedStreams = others + .sort(VideoService.sortPaginatedStreams) + .slice(chunkIndex, (chunkIndex + pageSize)) || []; + const streamsOnPage = [...mine, ...paginatedStreams]; + + return streamsOnPage; + } + getVideoStreams() { let streams = VideoStreams.find( { meetingId: Auth.meetingID }, @@ -179,11 +315,26 @@ class VideoService { const connectingStream = this.getConnectingStream(streams); if (connectingStream) streams.push(connectingStream); - return streams.map(vs => ({ + const mappedStreams = streams.map(vs => ({ cameraId: vs.stream, userId: vs.userId, name: vs.name, - })).sort(UserListService.sortUsersByName); + })); + + const pageSize = this.getMyPageSize(); + + // Pagination is either explictly disabled or pagination is set to 0 (which + // is equivalent to disabling it), so return the mapped streams as they are + // which produces the original non paginated behaviour + if (!PAGINATION_ENABLED || pageSize === 0) { + return { + streams: mappedStreams.sort(VideoService.sortMeshStreams), + totalNumberOfStreams: mappedStreams.length + }; + } + + const paginatedStreams = this.getVideoPage(mappedStreams, pageSize); + return { streams: paginatedStreams, totalNumberOfStreams: mappedStreams.length }; } getConnectingStream(streams) { @@ -227,9 +378,38 @@ class VideoService { return streams.find(s => s.stream === stream); } + getMyRole () { + return Users.findOne({ userId: Auth.userID }, + { fields: { role: 1 } })?.role; + } + + getRecord() { + if (this.record === null) { + this.record = getFromUserSettings('bbb_record_video', true); + } + + // TODO: Remove this + // This is a hack to handle a missing piece at the backend of a particular deploy. + // If, at the time the video is shared, the user has a viewer role and + // meta_hack-record-viewer-video is 'false' this user won't have this video + // stream recorded. + if (this.hackRecordViewer === null) { + const prop = Meetings.findOne( + { meetingId: Auth.meetingID }, + { fields: { 'metadataProp': 1 } }, + ).metadataProp; + + const value = prop.metadata ? prop.metadata['hack-record-viewer-video'] : null; + this.hackRecordViewer = value ? value.toLowerCase() === 'true' : true; + } + + const hackRecord = this.getMyRole() === ROLE_MODERATOR || this.hackRecordViewer; + + return this.record && hackRecord; + } + filterModeratorOnly(streams) { - const me = Users.findOne({ userId: Auth.userID }); - const amIViewer = me?.role === ROLE_VIEWER; + const amIViewer = this.getMyRole() === ROLE_VIEWER; if (amIViewer) { const moderators = Users.find( @@ -245,7 +425,7 @@ class VideoService { const { userId } = stream; const isModerator = moderators.includes(userId); - const isMe = me?.userId === userId; + const isMe = Auth.userID === userId; if (isModerator || isMe) result.push(stream); @@ -565,6 +745,7 @@ export default { addCandidateToPeer: (peer, candidate, cameraId) => videoService.addCandidateToPeer(peer, candidate, cameraId), processInboundIceQueue: (peer, cameraId) => videoService.processInboundIceQueue(peer, cameraId), getRole: isLocal => videoService.getRole(isLocal), + getRecord: () => videoService.getRecord(), getSharedDevices: () => videoService.getSharedDevices(), getSkipVideoPreview: fromInterface => videoService.getSkipVideoPreview(fromInterface), getUserParameterProfile: () => videoService.getUserParameterProfile(), @@ -576,4 +757,10 @@ export default { updateNumberOfDevices: devices => videoService.updateNumberOfDevices(devices), applyCameraProfile: (peer, newProfile) => videoService.applyCameraProfile(peer, newProfile), getThreshold: (numberOfPublishers) => videoService.getThreshold(numberOfPublishers), + isPaginationEnabled: () => videoService.isPaginationEnabled(), + getNumberOfPages: () => videoService.getNumberOfPages(), + getCurrentVideoPageIndex: () => videoService.getCurrentVideoPageIndex(), + getPreviousVideoPage: () => videoService.getPreviousVideoPage(), + getNextVideoPage: () => videoService.getNextVideoPage(), + getPageChangeDebounceTime: () => { return PAGE_CHANGE_DEBOUNCE_TIME }, }; diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.jsx index 210bfec8f9af83e1f0c03d0a960e46f3713e4c1c..d2b27787858e30916fa26e349ee73e8d39082bc6 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.jsx @@ -9,6 +9,8 @@ import { withDraggableConsumer } from '../../media/webcam-draggable-overlay/cont import AutoplayOverlay from '../../media/autoplay-overlay/component'; import logger from '/imports/startup/client/logger'; import playAndRetry from '/imports/utils/mediaElementPlayRetry'; +import VideoService from '/imports/ui/components/video-provider/service'; +import Button from '/imports/ui/components/button/component'; const propTypes = { streams: PropTypes.arrayOf(PropTypes.object).isRequired, @@ -16,6 +18,8 @@ const propTypes = { webcamDraggableDispatch: PropTypes.func.isRequired, intl: PropTypes.objectOf(Object).isRequired, swapLayout: PropTypes.bool.isRequired, + numberOfPages: PropTypes.number.isRequired, + currentVideoPageIndex: PropTypes.number.isRequired, }; const intlMessages = defineMessages({ @@ -37,6 +41,12 @@ const intlMessages = defineMessages({ autoplayAllowLabel: { id: 'app.videoDock.autoplayAllowLabel', }, + nextPageLabel: { + id: 'app.video.pagination.nextPage', + }, + prevPageLabel: { + id: 'app.video.pagination.prevPage', + }, }); const findOptimalGrid = (canvasWidth, canvasHeight, gutter, aspectRatio, numItems, columns = 1) => { @@ -209,6 +219,54 @@ class VideoList extends Component { this.ticking = true; } + renderNextPageButton() { + const { intl, numberOfPages, currentVideoPageIndex } = this.props; + + if (!VideoService.isPaginationEnabled() || numberOfPages <= 1) return null; + + const currentPage = currentVideoPageIndex + 1; + const nextPageLabel = intl.formatMessage(intlMessages.nextPageLabel); + const nextPageDetailedLabel = `${nextPageLabel} (${currentPage}/${numberOfPages})`; + + return ( + <Button + role="button" + aria-label={nextPageLabel} + color="primary" + icon="right_arrow" + size="md" + onClick={VideoService.getNextVideoPage} + label={nextPageDetailedLabel} + hideLabel + className={cx(styles.nextPage)} + /> + ); + } + + renderPreviousPageButton() { + const { intl, currentVideoPageIndex, numberOfPages } = this.props; + + if (!VideoService.isPaginationEnabled() || numberOfPages <= 1) return null; + + const currentPage = currentVideoPageIndex + 1; + const prevPageLabel = intl.formatMessage(intlMessages.prevPageLabel); + const prevPageDetailedLabel = `${prevPageLabel} (${currentPage}/${numberOfPages})`; + + return ( + <Button + role="button" + aria-label={prevPageLabel} + color="primary" + icon="left_arrow" + size="md" + onClick={VideoService.getPreviousVideoPage} + label={prevPageDetailedLabel} + hideLabel + className={cx(styles.previousPage)} + /> + ); + } + renderVideoList() { const { intl, @@ -277,6 +335,9 @@ class VideoList extends Component { }} className={canvasClassName} > + + {this.renderPreviousPageButton()} + {!streams.length ? null : ( <div ref={(ref) => { @@ -300,6 +361,9 @@ class VideoList extends Component { handleAllowAutoplay={this.handleAllowAutoplay} /> )} + + {this.renderNextPageButton()} + </div> ); } diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/container.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/container.jsx new file mode 100644 index 0000000000000000000000000000000000000000..7bd122a866c956119436600fb84359e230a33c25 --- /dev/null +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/container.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { withTracker } from 'meteor/react-meteor-data'; +import VideoList from '/imports/ui/components/video-provider/video-list/component'; +import VideoService from '/imports/ui/components/video-provider/service'; + +const VideoListContainer = ({ children, ...props }) => { + const { streams } = props; + return (!streams.length ? null : <VideoList{...props}>{children}</VideoList>); +}; + +export default withTracker(props => ({ + streams: props.streams, + onMount: props.onMount, + swapLayout: props.swapLayout, + numberOfPages: VideoService.getNumberOfPages(), + currentVideoPageIndex: props.currentVideoPageIndex, +}))(VideoListContainer); diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/styles.scss b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/styles.scss index 39c29954badaf5fa32d2fa7491b1b1ae408a1a3d..9d61fd9736f14c7b2da588b9bf5aa89850b30b04 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/styles.scss @@ -225,3 +225,35 @@ .voice { background-color: var(--color-success); } + +.nextPage, +.previousPage{ + color: var(--color-white); + width: var(--md-padding-x); + + i { + [dir="rtl"] & { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); + } + } +} + +.nextPage { + margin-left: 1px; + + @include mq($medium-up) { + margin-left: 2px; + } +} + +.previousPage { + margin-right: 1px; + + @include mq($medium-up) { + margin-right: 2px; + } +} diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.jsx index 4552e38df88960411baa5d431b54f19176f225f5..234959fdc589062c9ffd4f530d1a77fe05454c85 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.jsx @@ -62,10 +62,6 @@ class VideoListItem extends Component { const tagFailedEvent = new CustomEvent('videoPlayFailed', { detail: { mediaTag: elem } }); window.dispatchEvent(tagFailedEvent); } - logger.warn({ - logCode: 'videolistitem_component_play_maybe_error', - extraInfo: { error }, - }, `Could not play video tag due to ${error.name}`); }); } }; diff --git a/bigbluebutton-html5/private/config/settings.yml b/bigbluebutton-html5/private/config/settings.yml index 9eed35fa8fe5ca8f9071dff9555e63079ba73b80..78672e2c02c6cd73c24df763a9223cd0b5b245d2 100755 --- a/bigbluebutton-html5/private/config/settings.yml +++ b/bigbluebutton-html5/private/config/settings.yml @@ -27,6 +27,7 @@ public: ipv4FallbackDomain: "" allowLogout: true allowFullscreen: true + preloadNextSlides: 2 mutedAlert: enabled: true interval: 200 @@ -178,21 +179,27 @@ public: constraints: frameRate: 10 - id: low - name: Low quality + name: Low default: false bitrate: 100 - id: medium - name: Medium quality + name: Medium default: true bitrate: 200 - id: high - name: High quality + name: High default: false bitrate: 500 + constraints: + width: 1280 + frameRate: 15 - id: hd name: High definition default: false bitrate: 800 + constraints: + width: 1280 + frameRate: 30 enableScreensharing: true enableVideo: true enableVideoMenu: true @@ -218,6 +225,21 @@ public: profile: low-u25 - threshold: 30 profile: low-u30 + pagination: + # whether to globally enable or disable pagination. + enabled: false + # how long (in ms) the negotiation will be debounced after a page change. + pageChangeDebounceTime: 2500 + # video page sizes for DESKTOP endpoints. It stands for the number of SUBSCRIBER streams. + # PUBLISHERS aren't accounted for . + # A page size of 0 (zero) means that the page size is unlimited (disabled). + desktopPageSizes: + moderator: 0 + viewer: 5 + # video page sizes for MOBILE endpoints + mobilePageSizes: + moderator: 2 + viewer: 2 pingPong: clearUsersInSeconds: 180 pongTimeInSeconds: 15 diff --git a/bigbluebutton-html5/private/locales/ar.json b/bigbluebutton-html5/private/locales/ar.json index 04499ff51d63c4f7082205bb83c2a5bbfd34f770..f361ad44e06dd813d6a0e4c8fb4b00a55ccc68f6 100644 --- a/bigbluebutton-html5/private/locales/ar.json +++ b/bigbluebutton-html5/private/locales/ar.json @@ -50,10 +50,10 @@ "app.note.title": "Ù…Ù„Ø§ØØ¸Ø§Øª مشتركة", "app.note.label": "Ù…Ù„Ø§ØØ¸Ø©", "app.note.hideNoteLabel": "Ø¥Ø®ÙØ§Ø¡ Ø§Ù„Ù…Ù„Ø§ØØ¸Ø©", + "app.note.tipLabel": "اضغط Ø§Ù„Ù…ÙØªØ§Ø Esc للتركيز علي شريط أدوات Ø§Ù„Ù…ØØ±Ø±", "app.user.activityCheck": "التØÙ‚Ù‚ من نشاط المستخدم", "app.user.activityCheck.label": "التØÙ‚Ù‚ إن كان المستخدم لا يزال ÙÙŠ الاجتماع ({0})", "app.user.activityCheck.check": "تØÙ‚Ù‚", - "app.note.tipLabel": "اضغط Ø§Ù„Ù…ÙØªØ§Ø Esc للتركيز علي شريط أدوات Ø§Ù„Ù…ØØ±Ø±", "app.userList.usersTitle": "المستخدمون", "app.userList.participantsTitle": "المشاركون", "app.userList.messagesTitle": "الرسائل", diff --git a/bigbluebutton-html5/private/locales/az.json b/bigbluebutton-html5/private/locales/az.json index 1a22e9e292a6779eba6f1772f292e85cf0cfb670..449ba2203561ed36b405a0c5e9818bae5f7e6edb 100644 --- a/bigbluebutton-html5/private/locales/az.json +++ b/bigbluebutton-html5/private/locales/az.json @@ -50,10 +50,10 @@ "app.note.title": "QeydlÉ™ri bölüş", "app.note.label": "Qeyd", "app.note.hideNoteLabel": "QeydlÉ™ri gözlÉ™t", + "app.note.tipLabel": "DiqqÉ™ti redaktora yönlÉ™ndirmÉ™k üçün ESC düymÉ™sini sıxın.", "app.user.activityCheck": "İstifadəçi fÉ™aliyyÉ™tini yoxla", "app.user.activityCheck.label": "({0}) istifadəçilÉ™rin sessiyada olduÄŸunu yoxlayın", "app.user.activityCheck.check": "Yoxla", - "app.note.tipLabel": "DiqqÉ™ti redaktora yönlÉ™ndirmÉ™k üçün ESC düymÉ™sini sıxın.", "app.userList.usersTitle": "İstifadəçilÉ™r", "app.userList.participantsTitle": "İştirakçılar", "app.userList.messagesTitle": "Mesaj", diff --git a/bigbluebutton-html5/private/locales/bg_BG.json b/bigbluebutton-html5/private/locales/bg_BG.json index b54260ab2f9a004d48c242e2e0f6c063140bdabb..1a754413ebe99c138f7fbcedc1c3693df7eb6966 100644 --- a/bigbluebutton-html5/private/locales/bg_BG.json +++ b/bigbluebutton-html5/private/locales/bg_BG.json @@ -50,10 +50,10 @@ "app.note.title": "Споделени бележки", "app.note.label": "Бележка", "app.note.hideNoteLabel": "Скрий бележката", + "app.note.tipLabel": "ÐатиÑнете Esc за връщане в редактора", "app.user.activityCheck": "Проверка на потребителÑката активноÑÑ‚", "app.user.activityCheck.label": "Проверка дали Ð¿Ð¾Ñ‚Ñ€ÐµÐ±Ð¸Ñ‚ÐµÐ»Ñ Ðµ още в Ñрещата ({0})", "app.user.activityCheck.check": "Провери", - "app.note.tipLabel": "ÐатиÑнете Esc за връщане в редактора", "app.userList.usersTitle": "Потребители", "app.userList.participantsTitle": "УчаÑтници", "app.userList.messagesTitle": "СъобщениÑ", diff --git a/bigbluebutton-html5/private/locales/ca.json b/bigbluebutton-html5/private/locales/ca.json index 18cce65807782a84efbbd966d7211cbed45b2651..1a9847ea11a7d3da149cabcfb603f11c1fabb3d7 100644 --- a/bigbluebutton-html5/private/locales/ca.json +++ b/bigbluebutton-html5/private/locales/ca.json @@ -50,10 +50,10 @@ "app.note.title": "Notes compartides", "app.note.label": "Nota", "app.note.hideNoteLabel": "Amaga nota", + "app.note.tipLabel": "Prem Esc per a centrar la barra d'edició", "app.user.activityCheck": "Revisió de l'activitat d'usuari", "app.user.activityCheck.label": "Comprova si l'usuari encara està a la reunió ({0})", "app.user.activityCheck.check": "Comprova", - "app.note.tipLabel": "Prem Esc per a centrar la barra d'edició", "app.userList.usersTitle": "Usuaris", "app.userList.participantsTitle": "Participants", "app.userList.messagesTitle": "Missatges", diff --git a/bigbluebutton-html5/private/locales/cs_CZ.json b/bigbluebutton-html5/private/locales/cs_CZ.json index e8e1d8a995e4f964f7766ff3b4d23a76d85cb883..8475377f58f2b5ee998c0ab426bb7ced6f245886 100644 --- a/bigbluebutton-html5/private/locales/cs_CZ.json +++ b/bigbluebutton-html5/private/locales/cs_CZ.json @@ -50,10 +50,10 @@ "app.note.title": "SdÃlené poznámky", "app.note.label": "Poznámka", "app.note.hideNoteLabel": "Schovat poznámky", + "app.note.tipLabel": "ZmáÄknÄ›te klávesu Esc k vybránà panelu nástrojů", "app.user.activityCheck": "Kontrola aktivity uživatelů", "app.user.activityCheck.label": "Kontrola je li uživatel stále pÅ™Ãtomen v meetingu ({0})", "app.user.activityCheck.check": "Kontrola", - "app.note.tipLabel": "ZmáÄknÄ›te klávesu Esc k vybránà panelu nástrojů", "app.userList.usersTitle": "Uživatelé", "app.userList.participantsTitle": "ÚÄastnÃci", "app.userList.messagesTitle": "Zprávy", diff --git a/bigbluebutton-html5/private/locales/da.json b/bigbluebutton-html5/private/locales/da.json index 4e5fb06ee1bd276dd285014acef037167bec8ddc..bf3eb04b5477cd9111d15d153ed50ef11bcc81b9 100644 --- a/bigbluebutton-html5/private/locales/da.json +++ b/bigbluebutton-html5/private/locales/da.json @@ -50,10 +50,10 @@ "app.note.title": "Delte noter", "app.note.label": "Note", "app.note.hideNoteLabel": "Skjul note", + "app.note.tipLabel": "Tryk pÃ¥ Esc for at fokusere pÃ¥ redigeringsværktøjslinjen", "app.user.activityCheck": "Brugeraktivitetscheck", "app.user.activityCheck.label": "Kontroller, om brugeren stadig er i møde ({0})", "app.user.activityCheck.check": "Kontroller", - "app.note.tipLabel": "Tryk pÃ¥ Esc for at fokusere pÃ¥ redigeringsværktøjslinjen", "app.userList.usersTitle": "Brugere", "app.userList.participantsTitle": "Deltagere", "app.userList.messagesTitle": "Beskeder", diff --git a/bigbluebutton-html5/private/locales/de.json b/bigbluebutton-html5/private/locales/de.json index 2e15d49ab0fcbb9563dd68e44e4b8563650d361c..ea89cf4f4e900f6bb56096a1e2ca446b52744d93 100644 --- a/bigbluebutton-html5/private/locales/de.json +++ b/bigbluebutton-html5/private/locales/de.json @@ -50,10 +50,10 @@ "app.note.title": "Geteilte Notizen", "app.note.label": "Notiz", "app.note.hideNoteLabel": "Notiz verbergen", + "app.note.tipLabel": "Drücken Sie Esc, um die Editorwerkzeugliste auszuwählen", "app.user.activityCheck": "Teilnehmeraktivitätsprüfung", "app.user.activityCheck.label": "Prüfen, ob der Teilnehmer noch in der Konferenz ist ({0})", "app.user.activityCheck.check": "Prüfen", - "app.note.tipLabel": "Drücken Sie Esc, um die Editorwerkzeugliste auszuwählen", "app.userList.usersTitle": "Teilnehmer", "app.userList.participantsTitle": "Teilnehmer", "app.userList.messagesTitle": "Nachrichten", @@ -542,6 +542,10 @@ "app.recording.stopDescription": "Sind Sie sicher, dass Sie die Aufnahme pausieren wollen? Sie können Sie durch erneutes Drücken des Aufnahmeknopfs jederzeit fortsetzen.", "app.videoPreview.cameraLabel": "Kamera", "app.videoPreview.profileLabel": "Qualität", + "app.videoPreview.quality.low": "Niedrig", + "app.videoPreview.quality.medium": "Mittel", + "app.videoPreview.quality.high": "Hoch", + "app.videoPreview.quality.hd": "High Definition", "app.videoPreview.cancelLabel": "Abbrechen", "app.videoPreview.closeLabel": "Schließen", "app.videoPreview.findingWebcamsLabel": "Suche Webcams", @@ -578,6 +582,8 @@ "app.video.videoMenuDesc": "Videomenü öffnen", "app.video.chromeExtensionError": "Sie müssen Folgendes installieren:", "app.video.chromeExtensionErrorLink": "diese Chrome Erweiterung", + "app.video.pagination.prevPage": "Vorherige Videos ansehen", + "app.video.pagination.nextPage": "Nächste Videos ansehen", "app.fullscreenButton.label": "{0} zum Vollbild machen", "app.deskshare.iceConnectionStateError": "Verbindungsfehler beim Teilen des Bildschirms (Fehler 1108)", "app.sfu.mediaServerConnectionError2000": "Keine Verbindung zum Medienserver (Fehler 2000)", diff --git a/bigbluebutton-html5/private/locales/el_GR.json b/bigbluebutton-html5/private/locales/el_GR.json index a3fa1a0edb633a68c5192560a6779f6e79153be8..5a9cce44868bfa6b52575986499dcc09b92c9a9a 100644 --- a/bigbluebutton-html5/private/locales/el_GR.json +++ b/bigbluebutton-html5/private/locales/el_GR.json @@ -45,10 +45,10 @@ "app.note.title": "ΚοινόχÏηστες Σημειώσεις", "app.note.label": "Σημείωση", "app.note.hideNoteLabel": "ΑπόκÏυψη σημείωσης", + "app.note.tipLabel": "Πατήστε Esc για εστίαση στη γÏαμμή εÏγαλείων επεξεÏγαστή", "app.user.activityCheck": "Έλεγχος δÏαστηÏιότητας χÏηστών", "app.user.activityCheck.label": "Έλεγχος αν υπάÏχουν ακόμα χÏήστες μÎσα στη συνάντηση ({0})", "app.user.activityCheck.check": "Έλεγχος", - "app.note.tipLabel": "Πατήστε Esc για εστίαση στη γÏαμμή εÏγαλείων επεξεÏγαστή", "app.userList.usersTitle": "ΧÏήστες", "app.userList.participantsTitle": "ΣυμμετÎχοντες", "app.userList.messagesTitle": "ΜηνÏματα", diff --git a/bigbluebutton-html5/private/locales/en.json b/bigbluebutton-html5/private/locales/en.json index f73dbe331ed48c0fe2b7983e9a908de1cf68f149..783ad8410b59ae3ba1b6a75d084c7e033969403a 100755 --- a/bigbluebutton-html5/private/locales/en.json +++ b/bigbluebutton-html5/private/locales/en.json @@ -51,10 +51,10 @@ "app.note.title": "Shared Notes", "app.note.label": "Note", "app.note.hideNoteLabel": "Hide note", + "app.note.tipLabel": "Press Esc to focus editor toolbar", "app.user.activityCheck": "User activity check", "app.user.activityCheck.label": "Check if user is still in meeting ({0})", "app.user.activityCheck.check": "Check", - "app.note.tipLabel": "Press Esc to focus editor toolbar", "app.userList.usersTitle": "Users", "app.userList.participantsTitle": "Participants", "app.userList.messagesTitle": "Messages", @@ -570,6 +570,10 @@ "app.recording.stopDescription": "Are you sure you want to pause the recording? You can resume by selecting the record button again.", "app.videoPreview.cameraLabel": "Camera", "app.videoPreview.profileLabel": "Quality", + "app.videoPreview.quality.low": "Low", + "app.videoPreview.quality.medium": "Medium", + "app.videoPreview.quality.high": "High", + "app.videoPreview.quality.hd": "High definition", "app.videoPreview.cancelLabel": "Cancel", "app.videoPreview.closeLabel": "Close", "app.videoPreview.findingWebcamsLabel": "Finding webcams", @@ -606,6 +610,8 @@ "app.video.videoMenuDesc": "Open video menu dropdown", "app.video.chromeExtensionError": "You must install", "app.video.chromeExtensionErrorLink": "this Chrome extension", + "app.video.pagination.prevPage": "See previous videos", + "app.video.pagination.nextPage": "See next videos", "app.fullscreenButton.label": "Make {0} fullscreen", "app.deskshare.iceConnectionStateError": "Connection failed when sharing screen (ICE error 1108)", "app.sfu.mediaServerConnectionError2000": "Unable to connect to media server (error 2000)", diff --git a/bigbluebutton-html5/private/locales/eo.json b/bigbluebutton-html5/private/locales/eo.json index c0ef496956f7dee44e87fa742b645f1c4fd9e579..9c67127049951d108f7b341a6b30065a9a9992f7 100644 --- a/bigbluebutton-html5/private/locales/eo.json +++ b/bigbluebutton-html5/private/locales/eo.json @@ -50,10 +50,10 @@ "app.note.title": "Komunigitaj notoj", "app.note.label": "Noto", "app.note.hideNoteLabel": "KaÅi noton", + "app.note.tipLabel": "Premu Esc por enfokusigi la redaktilan ilobreton", "app.user.activityCheck": "Kontroli aktivecon de uzanto", "app.user.activityCheck.label": "Kontroli, ĉu uzanto ankoraÅ estas en kunsido ({0})", "app.user.activityCheck.check": "Kontroli", - "app.note.tipLabel": "Premu Esc por enfokusigi la redaktilan ilobreton", "app.userList.usersTitle": "Uzantoj", "app.userList.participantsTitle": "Partoprenantoj", "app.userList.messagesTitle": "MesaÄoj", diff --git a/bigbluebutton-html5/private/locales/es.json b/bigbluebutton-html5/private/locales/es.json index d86fdd12712c8de1e6d955874311703def40d156..dba04cac89d9f7f4185d32f8bd2643a9a0ed45f1 100644 --- a/bigbluebutton-html5/private/locales/es.json +++ b/bigbluebutton-html5/private/locales/es.json @@ -50,10 +50,10 @@ "app.note.title": "Notas compartidas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Ocultar nota", + "app.note.tipLabel": "Presione Esc para enfocar la barra de herramientas del editor", "app.user.activityCheck": "Comprobar actividad del usuario", "app.user.activityCheck.label": "Comprobar si el usuario continúa en la reunión ({0})", "app.user.activityCheck.check": "Comprobar", - "app.note.tipLabel": "Presione Esc para enfocar la barra de herramientas del editor", "app.userList.usersTitle": "Usuarios", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensajes", diff --git a/bigbluebutton-html5/private/locales/es_ES.json b/bigbluebutton-html5/private/locales/es_ES.json index 3f7c47acb3eafc27376cbb17e3027bc0627c40b1..ad0809c36e19c016203bb2bfc5a332167ed6e2b7 100644 --- a/bigbluebutton-html5/private/locales/es_ES.json +++ b/bigbluebutton-html5/private/locales/es_ES.json @@ -50,10 +50,10 @@ "app.note.title": "Notas compartidas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Nota oculta", + "app.note.tipLabel": "Presionar 'Esc' para situarse en la barra de herramientas del editor", "app.user.activityCheck": "Comprobación de la actividad del usuario", "app.user.activityCheck.label": "Comprobar si el usuario continúa en la reunión ({0})", "app.user.activityCheck.check": "Comprobar", - "app.note.tipLabel": "Presionar 'Esc' para situarse en la barra de herramientas del editor", "app.userList.usersTitle": "Usuarios", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensajes", diff --git a/bigbluebutton-html5/private/locales/es_MX.json b/bigbluebutton-html5/private/locales/es_MX.json index 0d220bd8d37237ac040e25f797a8640639ce1dfa..1da013f5d0d043ce615c5141bb513cacbbfd6864 100644 --- a/bigbluebutton-html5/private/locales/es_MX.json +++ b/bigbluebutton-html5/private/locales/es_MX.json @@ -25,10 +25,10 @@ "app.note.title": "Notas compartidas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Ocultar nota", + "app.note.tipLabel": "Pulse la tecla Esc para enfocar la barra de herramientas de edición", "app.user.activityCheck": "Verificar actividad del usuario", "app.user.activityCheck.label": "Verificar que el usuario se encuentre en la sesión ({0})", "app.user.activityCheck.check": "Verificar", - "app.note.tipLabel": "Pulse la tecla Esc para enfocar la barra de herramientas de edición", "app.userList.usersTitle": "Usuarios", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensajes", diff --git a/bigbluebutton-html5/private/locales/et.json b/bigbluebutton-html5/private/locales/et.json index e8d5ff2bf4e7ce2ca7a6d9c0cea7626e1ab7cdd9..81dc01fec90b76b1fca2e49301ce2f093839f111 100644 --- a/bigbluebutton-html5/private/locales/et.json +++ b/bigbluebutton-html5/private/locales/et.json @@ -50,10 +50,10 @@ "app.note.title": "Jagatud märkmed", "app.note.label": "Märge", "app.note.hideNoteLabel": "Peida märge", + "app.note.tipLabel": "Vajuta Esc-klahvi, et valida redaktori tööriistariba", "app.user.activityCheck": "Kasutaja tegevuse kontroll", "app.user.activityCheck.label": "Kontrolli kas kasutaja ({0}) on veel ruumis", "app.user.activityCheck.check": "Kontrolli", - "app.note.tipLabel": "Vajuta Esc-klahvi, et valida redaktori tööriistariba", "app.userList.usersTitle": "Kasutajad", "app.userList.participantsTitle": "Osalejad", "app.userList.messagesTitle": "Sõnumid", diff --git a/bigbluebutton-html5/private/locales/eu.json b/bigbluebutton-html5/private/locales/eu.json index 3ed75d0597ba3621176325556287c8d02c0e7d95..cee67986c7cc46588d2c296abda19ac7e177642f 100644 --- a/bigbluebutton-html5/private/locales/eu.json +++ b/bigbluebutton-html5/private/locales/eu.json @@ -50,10 +50,10 @@ "app.note.title": "Ohar Partekatuak", "app.note.label": "Oharra", "app.note.hideNoteLabel": "Ezkutatu oharra", + "app.note.tipLabel": "Sakatu Esc edizioaren tresna-barra fokuratzeko", "app.user.activityCheck": "Erabiltzailearen aktibitate-kontrola", "app.user.activityCheck.label": "Egiaztatu erabiltzailea oraindik bileran dagoen ({0})", "app.user.activityCheck.check": "Egiaztatu", - "app.note.tipLabel": "Sakatu Esc edizioaren tresna-barra fokuratzeko", "app.userList.usersTitle": "Erabiltzaileak", "app.userList.participantsTitle": "Parte-hartzaileak", "app.userList.messagesTitle": "Mezuak", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "Itxi", "app.videoPreview.findingWebcamsLabel": "Web-kamerak bilatzen", "app.videoPreview.startSharingLabel": "Hasi partekatzen", + "app.videoPreview.stopSharingLabel": "Gelditu partekatzea", + "app.videoPreview.stopSharingAllLabel": "Gelditu dena", + "app.videoPreview.sharedCameraLabel": "Kamera hori dagoeneko partekatuta dago", "app.videoPreview.webcamOptionLabel": "Aukeratu web-kamera", "app.videoPreview.webcamPreviewLabel": "Web-kameraren aurrebista", "app.videoPreview.webcamSettingsTitle": "Web-kameraren ezarpenak", @@ -588,6 +591,7 @@ "app.sfu.noAvailableCodec2203": "Zerbitzariak ezin du aurkitu kodeketa egokia (2203 errorea)", "app.meeting.endNotification.ok.label": "Ados", "app.whiteboard.annotations.poll": "Inkestaren emaitzak argitaratu dira", + "app.whiteboard.annotations.pollResult": "Inkestaren emaitza", "app.whiteboard.toolbar.tools": "Tresnak", "app.whiteboard.toolbar.tools.hand": "Eskua", "app.whiteboard.toolbar.tools.pencil": "Arkatza", diff --git a/bigbluebutton-html5/private/locales/fa_IR.json b/bigbluebutton-html5/private/locales/fa_IR.json index 3bbf096c15cdad478ea3bf24dd503d91cb3a8bfc..2324f8be60966d568fc6a9acc95d65ee0ed8abcf 100644 --- a/bigbluebutton-html5/private/locales/fa_IR.json +++ b/bigbluebutton-html5/private/locales/fa_IR.json @@ -50,10 +50,10 @@ "app.note.title": "یادداشت های اشتراکی", "app.note.label": "یادداشت", "app.note.hideNoteLabel": "پنهان کردن یادداشت", + "app.note.tipLabel": "برای ÙØ¹Ø§Ù„ کردن ادیتور نوار ابزار Esc را ÙØ´Ø§Ø± دهید", "app.user.activityCheck": "بررسی ÙØ¹Ø§Ù„یت کاربر", "app.user.activityCheck.label": "بررسی کنید آیا کاربر هنوز در جلسه ({0}) ØØ¶ÙˆØ± دارد", "app.user.activityCheck.check": "بررسی", - "app.note.tipLabel": "برای ÙØ¹Ø§Ù„ کردن ادیتور نوار ابزار Esc را ÙØ´Ø§Ø± دهید", "app.userList.usersTitle": "کاربران", "app.userList.participantsTitle": "شرکت کنندگان", "app.userList.messagesTitle": "پیام ها", @@ -63,7 +63,7 @@ "app.userList.presenter": "ارائه دهنده", "app.userList.you": "شما", "app.userList.locked": "Ù‚ÙÙ„ شده", - "app.userList.byModerator": "توسط (Moderator)", + "app.userList.byModerator": "توسط (مدیر)", "app.userList.label": "لیست کاربر", "app.userList.toggleCompactView.label": "تغییر در ØØ§Ù„ت نمایه ÙØ´Ø±Ø¯Ù‡", "app.userList.guest": "مهمان", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "بستن", "app.videoPreview.findingWebcamsLabel": "جستجوی وب Ú©Ù…", "app.videoPreview.startSharingLabel": "آغاز اشتراک گذاری", + "app.videoPreview.stopSharingLabel": "توق٠اشتراک گذاری", + "app.videoPreview.stopSharingAllLabel": "توق٠همه", + "app.videoPreview.sharedCameraLabel": "اشتراک گذاری دوربین پیش از این ÙØ¹Ø§Ù„ شده است.", "app.videoPreview.webcamOptionLabel": "انتخاب دوربین", "app.videoPreview.webcamPreviewLabel": "پیش نمایش دوربین", "app.videoPreview.webcamSettingsTitle": "تنظیمات دوربین", @@ -588,6 +591,7 @@ "app.sfu.noAvailableCodec2203": "سرور امکان ÛŒØ§ÙØªÙ† یک کدک مناسب را ندارد (خطای 2203)", "app.meeting.endNotification.ok.label": "تایید", "app.whiteboard.annotations.poll": "نتایج نظرسنجی منتشر شده است", + "app.whiteboard.annotations.pollResult": "نتایج نظرسنجی", "app.whiteboard.toolbar.tools": "ابزارها", "app.whiteboard.toolbar.tools.hand": "پن", "app.whiteboard.toolbar.tools.pencil": "مداد", diff --git a/bigbluebutton-html5/private/locales/fi.json b/bigbluebutton-html5/private/locales/fi.json index 295f3f0386c85fa8c2fffaef89506442b0efa9b9..25f308c129f6f5cb7199d8a1ed74e16bd4a0a0a7 100644 --- a/bigbluebutton-html5/private/locales/fi.json +++ b/bigbluebutton-html5/private/locales/fi.json @@ -39,10 +39,10 @@ "app.note.title": "Jaetut muistiinpanot", "app.note.label": "Muistiinpano", "app.note.hideNoteLabel": "Piilota muistiinpano", + "app.note.tipLabel": "Paina ESC-näppäintä keskittääksesi editorin työkaluriviin", "app.user.activityCheck": "Käyttäjien aktiivisuuden tarkistus", "app.user.activityCheck.label": "tarkista onko käyttäjä vielä tapaamisessa ({0})", "app.user.activityCheck.check": "Tarkista", - "app.note.tipLabel": "Paina ESC-näppäintä keskittääksesi editorin työkaluriviin", "app.userList.usersTitle": "Käyttäjät", "app.userList.participantsTitle": "Osallistujat", "app.userList.messagesTitle": "Viestit", diff --git a/bigbluebutton-html5/private/locales/fr.json b/bigbluebutton-html5/private/locales/fr.json index a42054606f41e06e71e63a31325710d2e0df6488..1f8de97b9ee53f0e165698e8adb613feedcbd701 100644 --- a/bigbluebutton-html5/private/locales/fr.json +++ b/bigbluebutton-html5/private/locales/fr.json @@ -50,10 +50,10 @@ "app.note.title": "Notes Partagées", "app.note.label": "Note", "app.note.hideNoteLabel": "Masquer la note", + "app.note.tipLabel": "Appuyez sur Echap pour centrer sur la barre d'outils de l'éditeur.", "app.user.activityCheck": "Vérification de l'activité de l'utilisateur", "app.user.activityCheck.label": "Vérifier si l'utilisateur est toujours en réunion ({0})", "app.user.activityCheck.check": "Vérifier", - "app.note.tipLabel": "Appuyez sur Echap pour centrer sur la barre d'outils de l'éditeur.", "app.userList.usersTitle": "Utilisateurs", "app.userList.participantsTitle": "Participants", "app.userList.messagesTitle": "Messages", diff --git a/bigbluebutton-html5/private/locales/gl.json b/bigbluebutton-html5/private/locales/gl.json index 106341f499737888fc4ccf943f5117525f6be919..d642dffdc07a67bbde01a3f6f231dca16e0924f5 100644 --- a/bigbluebutton-html5/private/locales/gl.json +++ b/bigbluebutton-html5/private/locales/gl.json @@ -50,10 +50,10 @@ "app.note.title": "Notas compartidas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Agochar nota", + "app.note.tipLabel": "Prema Esc para enfocar a barra de ferramentas do editor", "app.user.activityCheck": "Comprobar a actividade do usuario", "app.user.activityCheck.label": "Comprobar se o usuario aÃnda está na xuntanza ({0})", "app.user.activityCheck.check": "Comprobar", - "app.note.tipLabel": "Prema Esc para enfocar a barra de ferramentas do editor", "app.userList.usersTitle": "Usuarios", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensaxes", @@ -542,6 +542,10 @@ "app.recording.stopDescription": "Confirma que quere deter a gravación? Pode continuala premendo de novo o botón de gravación.", "app.videoPreview.cameraLabel": "Cámara web", "app.videoPreview.profileLabel": "Calidade", + "app.videoPreview.quality.low": "Baixa", + "app.videoPreview.quality.medium": "Media", + "app.videoPreview.quality.high": "Alta", + "app.videoPreview.quality.hd": "Alta definición", "app.videoPreview.cancelLabel": "Cancelar", "app.videoPreview.closeLabel": "Pechar", "app.videoPreview.findingWebcamsLabel": "Buscando cámaras web", @@ -578,6 +582,8 @@ "app.video.videoMenuDesc": "Abrir o menú despregable de vÃdeo", "app.video.chromeExtensionError": "Debe instalar", "app.video.chromeExtensionErrorLink": "esta extensión de Chrome", + "app.video.pagination.prevPage": "Ver os vÃdeos anteriores", + "app.video.pagination.nextPage": "Ver os seguintes vÃdeos", "app.fullscreenButton.label": "Poñer {0} a pantalla completa", "app.deskshare.iceConnectionStateError": "Produciuse un fallo de conexión ao compartir a pantalla (erro ICE 1108)", "app.sfu.mediaServerConnectionError2000": "Non foi posÃbel conectar co servidor multimedia (erro 2000)", diff --git a/bigbluebutton-html5/private/locales/he.json b/bigbluebutton-html5/private/locales/he.json index 45aae44f33fa002b6a6738667c84f03cee843c58..75ffc4966c1d74694d1440b48a39b9142e087da8 100644 --- a/bigbluebutton-html5/private/locales/he.json +++ b/bigbluebutton-html5/private/locales/he.json @@ -50,10 +50,10 @@ "app.note.title": "×¤× ×§×¡ משותף", "app.note.label": "פתקית", "app.note.hideNoteLabel": "הסתר פתקית", + "app.note.tipLabel": "לחץ Esc למעבר לסרגל הכלי×", "app.user.activityCheck": "בדיקת ×–×ž×™× ×•×ª משתמש", "app.user.activityCheck.label": "בדוק ×× ×”×ž×©×ª×ž×© עדיין במפגש ({0})", "app.user.activityCheck.check": "בדוק", - "app.note.tipLabel": "לחץ Esc למעבר לסרגל הכלי×", "app.userList.usersTitle": "משתתפי×", "app.userList.participantsTitle": "משתתפי×", "app.userList.messagesTitle": "הודעות", diff --git a/bigbluebutton-html5/private/locales/hi_IN.json b/bigbluebutton-html5/private/locales/hi_IN.json index 59c3ac865ec01920e489cf1cf44628313860cadc..6e8005ecb76d0c4be087dfe9f796e1a1f1e0be19 100644 --- a/bigbluebutton-html5/private/locales/hi_IN.json +++ b/bigbluebutton-html5/private/locales/hi_IN.json @@ -49,10 +49,10 @@ "app.note.title": "साà¤à¤¾ किठगठनोटà¥à¤¸", "app.note.label": "धà¥à¤¯à¤¾à¤¨ दें", "app.note.hideNoteLabel": "नोट छिपाà¤à¤‚", + "app.note.tipLabel": "संपादक टूलबार पर धà¥à¤¯à¤¾à¤¨ केंदà¥à¤°à¤¿à¤¤ करने के लिठEsc दबाà¤à¤‚", "app.user.activityCheck": "उपयोगकरà¥à¤¤à¤¾ गतिविधि की जाà¤à¤š करें", "app.user.activityCheck.label": "जांचें कि कà¥à¤¯à¤¾ उपयोगकरà¥à¤¤à¤¾ अà¤à¥€ à¤à¥€ मिल रहा है ({0})", "app.user.activityCheck.check": "चेक", - "app.note.tipLabel": "संपादक टूलबार पर धà¥à¤¯à¤¾à¤¨ केंदà¥à¤°à¤¿à¤¤ करने के लिठEsc दबाà¤à¤‚", "app.userList.usersTitle": "उपयोगकरà¥à¤¤à¤¾à¤“ं", "app.userList.participantsTitle": "पà¥à¤°à¤¤à¤¿à¤à¤¾à¤—ियों", "app.userList.messagesTitle": "संदेश", diff --git a/bigbluebutton-html5/private/locales/hu_HU.json b/bigbluebutton-html5/private/locales/hu_HU.json index ef73ca5d277a0d6ba43a98bd334d80acf3e51f07..f78d4e943171aa001a5862034eb2b6cb14b7c8bb 100644 --- a/bigbluebutton-html5/private/locales/hu_HU.json +++ b/bigbluebutton-html5/private/locales/hu_HU.json @@ -50,10 +50,10 @@ "app.note.title": "Megosztott jegyzetek", "app.note.label": "Jegyzetek", "app.note.hideNoteLabel": "Jegyzet elrejtése", + "app.note.tipLabel": "Nyomj Esc-et a szerkesztÅ‘ eszköztárra fokuszálásához", "app.user.activityCheck": "Felhasználói aktivitás ellenÅ‘rzése", "app.user.activityCheck.label": "EllenÅ‘rzi, hogy a felhasználó még az elÅ‘adás résztvevÅ‘je-e ({0})", "app.user.activityCheck.check": "EllenÅ‘rzés", - "app.note.tipLabel": "Nyomj Esc-et a szerkesztÅ‘ eszköztárra fokuszálásához", "app.userList.usersTitle": "Felhasználók", "app.userList.participantsTitle": "RésztvevÅ‘k", "app.userList.messagesTitle": "Üzenetek", diff --git a/bigbluebutton-html5/private/locales/id.json b/bigbluebutton-html5/private/locales/id.json index dc29a0f78096f64dd6dac6e8d8835409d71b4900..9f7df42a3a9d705027a57a68618f8cb9a4b4307a 100644 --- a/bigbluebutton-html5/private/locales/id.json +++ b/bigbluebutton-html5/private/locales/id.json @@ -50,10 +50,10 @@ "app.note.title": "Catatan Bersama", "app.note.label": "Catatan", "app.note.hideNoteLabel": "Sembunyikan catatan", + "app.note.tipLabel": "Tekan Esc untuk fokus ke bilah alat penyunting", "app.user.activityCheck": "Pemeriksaan aktivitas pengguna", "app.user.activityCheck.label": "Periksa apakah pengguna masih dalam pertemuan ({0})", "app.user.activityCheck.check": "Periksa", - "app.note.tipLabel": "Tekan Esc untuk fokus ke bilah alat penyunting", "app.userList.usersTitle": "Pengguna", "app.userList.participantsTitle": "Peserta", "app.userList.messagesTitle": "Pesan", diff --git a/bigbluebutton-html5/private/locales/it_IT.json b/bigbluebutton-html5/private/locales/it_IT.json index ca61627e498bb3561d928425efc8fa37e66716a1..3ad087586232260521eb1388f661c97a749eb9cd 100644 --- a/bigbluebutton-html5/private/locales/it_IT.json +++ b/bigbluebutton-html5/private/locales/it_IT.json @@ -50,10 +50,10 @@ "app.note.title": "Note condivise", "app.note.label": "Note", "app.note.hideNoteLabel": "Nascondi nota", + "app.note.tipLabel": "Premi ESC per utilizzare la barra degli strumenti", "app.user.activityCheck": "Controllo attività utente", "app.user.activityCheck.label": "Controlla se l'utente è ancora nella meeting ({0})", "app.user.activityCheck.check": "Controlla", - "app.note.tipLabel": "Premi ESC per utilizzare la barra degli strumenti", "app.userList.usersTitle": "Utenti", "app.userList.participantsTitle": "Partecipanti", "app.userList.messagesTitle": "Messaggi", diff --git a/bigbluebutton-html5/private/locales/ja.json b/bigbluebutton-html5/private/locales/ja.json index 21160934ae5f25ffd2819530335951319fedaa3e..79f1cf63ae273620271418ccdef61cf5a2879f1a 100644 --- a/bigbluebutton-html5/private/locales/ja.json +++ b/bigbluebutton-html5/private/locales/ja.json @@ -50,10 +50,10 @@ "app.note.title": "共有メモ", "app.note.label": "メモ", "app.note.hideNoteLabel": "ãƒ¡ãƒ¢ã‚’éš ã™", + "app.note.tipLabel": "Escを押ã—ã¦ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ãƒ„ールãƒãƒ¼ã«ãƒ•ォーカスã™ã‚‹", "app.user.activityCheck": "ユーザーアクティビティ確èª", "app.user.activityCheck.label": "会è°({0})ã«ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒã¾ã å‚åŠ ã—ã¦ã„ã‚‹ã‹ç¢ºèªã™ã‚‹", "app.user.activityCheck.check": "確èª", - "app.note.tipLabel": "Escを押ã—ã¦ã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ãƒ„ールãƒãƒ¼ã«ãƒ•ォーカスã™ã‚‹", "app.userList.usersTitle": "ユーザー", "app.userList.participantsTitle": "å‚åŠ è€…", "app.userList.messagesTitle": "メッセージ", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "é–‰ã˜ã‚‹", "app.videoPreview.findingWebcamsLabel": "ウェブカメラå–å¾—ä¸", "app.videoPreview.startSharingLabel": "共有を開始", + "app.videoPreview.stopSharingLabel": "å…±æœ‰ã‚’åœæ¢", + "app.videoPreview.stopSharingAllLabel": "å…¨ã¦åœæ¢", + "app.videoPreview.sharedCameraLabel": "ã“ã®ã‚«ãƒ¡ãƒ©ã¯ã™ã§ã«å…±æœ‰ã•れã¦ã„ã¾ã™", "app.videoPreview.webcamOptionLabel": "ã‚¦ã‚§ãƒ–ã‚«ãƒ¡ãƒ©ã‚’é¸æŠž", "app.videoPreview.webcamPreviewLabel": "ウェブカメラã®ãƒ—レビュー", "app.videoPreview.webcamSettingsTitle": "ウェブカメラè¨å®š", diff --git a/bigbluebutton-html5/private/locales/ja_JP.json b/bigbluebutton-html5/private/locales/ja_JP.json index 95f42bdc3e6f855754ece26204d53105b7852563..276278b26c97625f84e54c4d175efc6b499be0a6 100644 --- a/bigbluebutton-html5/private/locales/ja_JP.json +++ b/bigbluebutton-html5/private/locales/ja_JP.json @@ -50,10 +50,10 @@ "app.note.title": "共有メモ", "app.note.label": "メモ", "app.note.hideNoteLabel": "ãƒ¡ãƒ¢ã‚’éš ã™", + "app.note.tipLabel": "ツールãƒãƒ¼ã‹ã‚‰å½¢å¼ã‚’é¸æŠžã™ã‚‹ã«ã¯Escã‚ーを押ã—ã¾ã™", "app.user.activityCheck": "ユーザーアクティビティ確èª", "app.user.activityCheck.label": "会è°({0})ã«å‚åŠ ä¸ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒã„ã‚‹ã‹ç¢ºèªã™ã‚‹", "app.user.activityCheck.check": "確èª", - "app.note.tipLabel": "ツールãƒãƒ¼ã‹ã‚‰å½¢å¼ã‚’é¸æŠžã™ã‚‹ã«ã¯Escã‚ーを押ã—ã¾ã™", "app.userList.usersTitle": "ユーザー", "app.userList.participantsTitle": "å‚åŠ è€…", "app.userList.messagesTitle": "メッセージ", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "é–‰ã˜ã‚‹", "app.videoPreview.findingWebcamsLabel": "ウェブカメラå–å¾—ä¸", "app.videoPreview.startSharingLabel": "共有を開始", + "app.videoPreview.stopSharingLabel": "å…±æœ‰ã‚’åœæ¢", + "app.videoPreview.stopSharingAllLabel": "å…¨ã¦åœæ¢", + "app.videoPreview.sharedCameraLabel": "ã“ã®ã‚«ãƒ¡ãƒ©ã¯ã™ã§ã«å…±æœ‰ã•れã¦ã„ã¾ã™", "app.videoPreview.webcamOptionLabel": "ã‚¦ã‚§ãƒ–ã‚«ãƒ¡ãƒ©ã‚’é¸æŠž", "app.videoPreview.webcamPreviewLabel": "ウェブカメラã®ãƒ—レビュー", "app.videoPreview.webcamSettingsTitle": "ウェブカメラè¨å®š", diff --git a/bigbluebutton-html5/private/locales/ka_GE.json b/bigbluebutton-html5/private/locales/ka_GE.json index 622cac7cb846c6f5457796a6e9404cf46ddf7420..4b2be81409a06674a939445cc3d47faaf6c28b14 100644 --- a/bigbluebutton-html5/private/locales/ka_GE.json +++ b/bigbluebutton-html5/private/locales/ka_GE.json @@ -50,10 +50,10 @@ "app.note.title": "სáƒáƒ”რთრჩáƒáƒœáƒáƒ¬áƒ”რები", "app.note.label": "ჩáƒáƒœáƒáƒ¬áƒ”რი", "app.note.hideNoteLabel": "ჩáƒáƒœáƒáƒ¬áƒ”რის დáƒáƒ¤áƒáƒ ვáƒ", + "app.note.tipLabel": "დáƒáƒ¬áƒ™áƒáƒžáƒ”თ Esc რედáƒáƒ¥áƒ¢áƒ˜áƒ ების ზáƒáƒšáƒ˜áƒ¡ ფáƒáƒ™áƒ£áƒ¡áƒ˜áƒ ებისთვის", "app.user.activityCheck": "მáƒáƒ›áƒ®áƒ›áƒáƒ ებლის áƒáƒ¥áƒ¢áƒ˜áƒ•áƒáƒ‘ის შემáƒáƒ¬áƒ›áƒ”ბáƒ", "app.user.activityCheck.label": "შეáƒáƒ›áƒáƒ¬áƒ›áƒ”თ, ისევ ესწრებრთუ áƒáƒ რმáƒáƒ›áƒ®áƒ›áƒáƒ ებელი ({0}) შეხვედრáƒáƒ¡", "app.user.activityCheck.check": "შემáƒáƒ¬áƒ›áƒ”ბáƒ", - "app.note.tipLabel": "დáƒáƒ¬áƒ™áƒáƒžáƒ”თ Esc რედáƒáƒ¥áƒ¢áƒ˜áƒ ების ზáƒáƒšáƒ˜áƒ¡ ფáƒáƒ™áƒ£áƒ¡áƒ˜áƒ ებისთვის", "app.userList.usersTitle": "მáƒáƒ›áƒ®áƒ›áƒáƒ ებლები", "app.userList.participantsTitle": "მáƒáƒœáƒáƒ¬áƒ˜áƒšáƒ”ები", "app.userList.messagesTitle": "შეტყáƒáƒ‘ინებები", diff --git a/bigbluebutton-html5/private/locales/km.json b/bigbluebutton-html5/private/locales/km.json index b89db012ccbe76e627976bf5551fdefbaeeecdd3..89a32c6010ad46e193d274bf35fc78f4f0d7e836 100644 --- a/bigbluebutton-html5/private/locales/km.json +++ b/bigbluebutton-html5/private/locales/km.json @@ -50,10 +50,10 @@ "app.note.title": "កំណážáŸ‹ážáŸ’រារួមគ្នា", "app.note.label": "កំណážáŸ‹ážáŸ’ážšáž¶", "app.note.hideNoteLabel": "លាក់កំណážáŸ‹ážáŸ’ážšáž¶", + "app.note.tipLabel": "ចុច Esc ដើម្បីផ្ážáŸ„ážáž‘ៅលើរបារឧបករណáŸážŸáž˜áŸ’រាប់កម្មវិធីសរសáŸážš", "app.user.activityCheck": "ការពិនិážáŸ’យសកម្មភាពអ្នកចូលរួម", "app.user.activityCheck.label": "ពិនិážáŸ’áž™ážáž¶ážáž¾áž¢áŸ’នកចូលរួមនៅក្នុងកិច្ចប្រជុំទៀážáž‘០({0})", "app.user.activityCheck.check": "ពិនិážáŸ’áž™", - "app.note.tipLabel": "ចុច Esc ដើម្បីផ្ážáŸ„ážáž‘ៅលើរបារឧបករណáŸážŸáž˜áŸ’រាប់កម្មវិធីសរសáŸážš", "app.userList.usersTitle": "អ្នកចូលរួម", "app.userList.participantsTitle": "អ្នកចូលរួម", "app.userList.messagesTitle": "សារ", diff --git a/bigbluebutton-html5/private/locales/kn.json b/bigbluebutton-html5/private/locales/kn.json index aa92d24df195f3bf43152fb525a120ef3e33661a..c6e1d75002f2ec81e416c235649eef2a7fd58a2a 100644 --- a/bigbluebutton-html5/private/locales/kn.json +++ b/bigbluebutton-html5/private/locales/kn.json @@ -50,10 +50,10 @@ "app.note.title": "ಹಂಚಿದ ಟಿಪà³à²ªà²£à²¿à²—ಳà³", "app.note.label": "ಸೂಚನೆ", "app.note.hideNoteLabel": "ಟಿಪà³à²ªà²£à²¿ ಮರೆಮಾಡಿ", + "app.note.tipLabel": "ಫೋಕಸೠಎಡಿಟರೠಟೂಲà³â€Œà²¬à²¾à²°à³ ಮಾಡಲೠEsc ಒತà³à²¤à²¿à²°à²¿", "app.user.activityCheck": "ಬಳಕೆದಾರರ ಚಟà³à²µà²Ÿà²¿à²•ೆ ಪರಿಶೀಲನೆ", "app.user.activityCheck.label": "ಬಳಕೆದಾರರೠಇನà³à²¨à³‚ ಸà²à³†à²¯à²²à³à²²à²¿à²¦à³à²¦à²¾à²°à³†à²¯à³‡ ಎಂದೠಪರಿಶೀಲಿಸಿ ({0})", "app.user.activityCheck.check": "ಪರಿಶೀಲಿಸಿ", - "app.note.tipLabel": "ಫೋಕಸೠಎಡಿಟರೠಟೂಲà³â€Œà²¬à²¾à²°à³ ಮಾಡಲೠEsc ಒತà³à²¤à²¿à²°à²¿", "app.userList.usersTitle": "ಬಳಕೆದಾರರà³", "app.userList.participantsTitle": "à²à²¾à²—ವಹಿಸà³à²µà²µà²°à³", "app.userList.messagesTitle": "ಸಂದೇಶಗಳà³", diff --git a/bigbluebutton-html5/private/locales/ko_KR.json b/bigbluebutton-html5/private/locales/ko_KR.json index 3c540170760670827ff888b22e2d740f7ece973d..e63e869ff3f2af619ef5253ec307b76b5bae5a7d 100644 --- a/bigbluebutton-html5/private/locales/ko_KR.json +++ b/bigbluebutton-html5/private/locales/ko_KR.json @@ -50,10 +50,10 @@ "app.note.title": "노트 ê³µìœ ", "app.note.label": "노트", "app.note.hideNoteLabel": "노트 숨기기", + "app.note.tipLabel": "ì—디터 íˆ´ë°”ì— í¬ì»¤ìŠ¤ë¥¼ 위해 ESC 를 누르세요", "app.user.activityCheck": "ì‚¬ìš©ìž í™œë™ ì²´í¬", "app.user.activityCheck.label": "사용ìžê°€ ({0})ë¯¸íŒ…ì— ì•„ì§ ìžˆëŠ”ì§€ ì²´í¬", "app.user.activityCheck.check": "ì²´í¬", - "app.note.tipLabel": "ì—디터 íˆ´ë°”ì— í¬ì»¤ìŠ¤ë¥¼ 위해 ESC 를 누르세요", "app.userList.usersTitle": "사용ìž", "app.userList.participantsTitle": "참가ìž", "app.userList.messagesTitle": "메시지", diff --git a/bigbluebutton-html5/private/locales/lt_LT.json b/bigbluebutton-html5/private/locales/lt_LT.json index ea45371018a3ae5bddcb1c31d1e2e7760a7677b0..fdc80818ba29e7a2a0a2e497f922bae990a7e750 100644 --- a/bigbluebutton-html5/private/locales/lt_LT.json +++ b/bigbluebutton-html5/private/locales/lt_LT.json @@ -50,10 +50,10 @@ "app.note.title": "Bendri užraÅ¡ai", "app.note.label": "UžraÅ¡ai", "app.note.hideNoteLabel": "PaslÄ—pti užrašą", + "app.note.tipLabel": "Paspauskite ESC kad sufokusuoti redaktoriaus įrankinÄ™.", "app.user.activityCheck": "Vartotojo aktyvumo patikra", "app.user.activityCheck.label": "Patikrina ar vartotojas vis dar yra susitikime ({0})", "app.user.activityCheck.check": "Patikrinti", - "app.note.tipLabel": "Paspauskite ESC kad sufokusuoti redaktoriaus įrankinÄ™.", "app.userList.usersTitle": "Vartotojai", "app.userList.participantsTitle": "Dalyviai", "app.userList.messagesTitle": "ŽinutÄ—s", diff --git a/bigbluebutton-html5/private/locales/lv.json b/bigbluebutton-html5/private/locales/lv.json index 5d161c48d3ea2c6fd9349c7678bbb908b6013997..13f4e103a258f6a246bc56a18d9c61a32b89cdbe 100644 --- a/bigbluebutton-html5/private/locales/lv.json +++ b/bigbluebutton-html5/private/locales/lv.json @@ -50,10 +50,10 @@ "app.note.title": "KopÄ«gÄs piezÄ«mes", "app.note.label": "PiezÄ«me", "app.note.hideNoteLabel": "NerÄdÄ«t piezÄ«mi", + "app.note.tipLabel": "Nospiediet ESC lai fokusÄ“tos uz redaktora rÄ«krindu", "app.user.activityCheck": "DalÄ«bnieka aktivitÄtes pÄrbaude", "app.user.activityCheck.label": "PÄrbaudÄ«t, vai dalÄ«bnieks joprojÄm ir sapulcÄ“ ({0})", "app.user.activityCheck.check": "PÄrbaudÄ«t", - "app.note.tipLabel": "Nospiediet ESC lai fokusÄ“tos uz redaktora rÄ«krindu", "app.userList.usersTitle": "DalÄ«bnieki", "app.userList.participantsTitle": "DalÄ«bnieki", "app.userList.messagesTitle": "Ziņas", diff --git a/bigbluebutton-html5/private/locales/nb_NO.json b/bigbluebutton-html5/private/locales/nb_NO.json index 9f9281475fa1439f42b83e93fa20e0dd30ed3f86..9e478e71f6074925e687bbdd5cf3ea88b2f6b14e 100644 --- a/bigbluebutton-html5/private/locales/nb_NO.json +++ b/bigbluebutton-html5/private/locales/nb_NO.json @@ -50,10 +50,10 @@ "app.note.title": "Delte notater", "app.note.label": "Notat", "app.note.hideNoteLabel": "Skjul notat", + "app.note.tipLabel": "Trykk escape for Ã¥ fokusere pÃ¥ verktøylinjen for redigering", "app.user.activityCheck": "Sjekk brukeraktivitet", "app.user.activityCheck.label": "Sjekk at bruker fortsatt er i møtet ({0})", "app.user.activityCheck.check": "Sjekk", - "app.note.tipLabel": "Trykk escape for Ã¥ fokusere pÃ¥ verktøylinjen for redigering", "app.userList.usersTitle": "Brukere", "app.userList.participantsTitle": "Deltagere", "app.userList.messagesTitle": "Meldinger", diff --git a/bigbluebutton-html5/private/locales/nl.json b/bigbluebutton-html5/private/locales/nl.json index dfba8a7d3861b07286ba4d4ba76a02651680b593..95822a5fcd28d3e4ca883bff05be28c033ab2fc7 100644 --- a/bigbluebutton-html5/private/locales/nl.json +++ b/bigbluebutton-html5/private/locales/nl.json @@ -50,10 +50,10 @@ "app.note.title": "Gedeelde notities", "app.note.label": "Notitie", "app.note.hideNoteLabel": "Verberg notitie", + "app.note.tipLabel": "Druk op Esc om de werkbalk van de editor te activeren", "app.user.activityCheck": "Controle gebruikersactiviteit", "app.user.activityCheck.label": "Controleer of de gebruiker nog steeds in vergadering is ({0})", "app.user.activityCheck.check": "Controleren", - "app.note.tipLabel": "Druk op Esc om de werkbalk van de editor te activeren", "app.userList.usersTitle": "Gebruikers", "app.userList.participantsTitle": "Deelnemers", "app.userList.messagesTitle": "Berichten", @@ -542,6 +542,10 @@ "app.recording.stopDescription": "Weet u zeker dat u de opname wilt pauzeren? U kunt later doorgaan door de opnieuw op de opnameknop te klikken.", "app.videoPreview.cameraLabel": "Camera", "app.videoPreview.profileLabel": "Kwaliteit", + "app.videoPreview.quality.low": "Laag", + "app.videoPreview.quality.medium": "Medium", + "app.videoPreview.quality.high": "Hoog", + "app.videoPreview.quality.hd": "Hoge kwaliteit", "app.videoPreview.cancelLabel": "Annuleren", "app.videoPreview.closeLabel": "Sluiten", "app.videoPreview.findingWebcamsLabel": "Webcams zoeken", @@ -578,6 +582,8 @@ "app.video.videoMenuDesc": "Vervolgkeuzelijst Videomenu openen", "app.video.chromeExtensionError": "U moet installeren", "app.video.chromeExtensionErrorLink": "deze Chrome-extensie", + "app.video.pagination.prevPage": "Zie eerdere video's", + "app.video.pagination.nextPage": "Zie volgende video's", "app.fullscreenButton.label": "Maak {0} volledig scherm", "app.deskshare.iceConnectionStateError": "Verbinding mislukt tijdens delen van scherm (ICE error 1108)", "app.sfu.mediaServerConnectionError2000": "Kan geen verbinding maken met mediaserver (fout 2000)", diff --git a/bigbluebutton-html5/private/locales/pl_PL.json b/bigbluebutton-html5/private/locales/pl_PL.json index fbdc74757c39ecd2bc3147902878af92db04d5ac..ba8190b08f1eb3110ddc60504287cf23605e4612 100644 --- a/bigbluebutton-html5/private/locales/pl_PL.json +++ b/bigbluebutton-html5/private/locales/pl_PL.json @@ -50,10 +50,10 @@ "app.note.title": "Wspólne notatki", "app.note.label": "Notatka", "app.note.hideNoteLabel": "Ukryj notatkÄ™", + "app.note.tipLabel": "NaciÅ›nij Esc by aktywować pasek narzÄ™dziowy edytora", "app.user.activityCheck": "Sprawdź aktywność uczestnika", "app.user.activityCheck.label": "Sprawdź czy uczestnik nadal uczestniczy w spotkaniu ({0})", "app.user.activityCheck.check": "Sprawdź", - "app.note.tipLabel": "NaciÅ›nij Esc by aktywować pasek narzÄ™dziowy edytora", "app.userList.usersTitle": "Uczestnicy", "app.userList.participantsTitle": "Uczestnicy", "app.userList.messagesTitle": "WiadomoÅ›ci", diff --git a/bigbluebutton-html5/private/locales/pt.json b/bigbluebutton-html5/private/locales/pt.json index 8d3eea8ac0395ebfac37d5e1b8be2c12cd6b23e9..9ad0c266f40eff912247a3544406de630915abef 100644 --- a/bigbluebutton-html5/private/locales/pt.json +++ b/bigbluebutton-html5/private/locales/pt.json @@ -1,5 +1,5 @@ { - "app.home.greeting": "A sessão vai iniciar em breve ...", + "app.home.greeting": "A apresentação vai iniciar em breve ...", "app.chat.submitLabel": "Enviar mensagem", "app.chat.errorMaxMessageLength": "Mensagem maior do que {0} caracter(es)", "app.chat.disconnected": "Está desligado, pelo que mensagens não podem ser enviadas", @@ -50,10 +50,10 @@ "app.note.title": "Notas Partilhadas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Ocultar nota", + "app.note.tipLabel": "Prima Esc para barra voltar à barra de ferramentas do editor", "app.user.activityCheck": "Verificar atividade do utilizador", "app.user.activityCheck.label": "Verificar se o utilizador ainda está na sessão ({0})", "app.user.activityCheck.check": "Verificar", - "app.note.tipLabel": "Prima Esc para barra voltar à barra de ferramentas do editor", "app.userList.usersTitle": "Utilizadores", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensagens", @@ -126,6 +126,10 @@ "app.meeting.meetingTimeRemaining": "Tempo restante da sessão: {0}", "app.meeting.meetingTimeHasEnded": "Tempo limite atingido. A sessão vai fechar dentro de momentos", "app.meeting.endedMessage": "Vai ser redirecionado para o ecrã inicial", + "app.meeting.alertMeetingEndsUnderMinutesSingular": "Esta sessão vai encerrar dentro de um minuto.", + "app.meeting.alertMeetingEndsUnderMinutesPlural": "Esta sessão vai fechar dentro de {0} minutos.", + "app.meeting.alertBreakoutEndsUnderMinutesPlural": "Esta sala de grupo vai fechar dentro de {0} minutos.", + "app.meeting.alertBreakoutEndsUnderMinutesSingular": "Esta sala de grupo vai fechar dentro de um minuto.", "app.presentation.hide": "Ocultar a apresentação", "app.presentation.notificationLabel": "Apresentação atual", "app.presentation.slideContent": "Conteúdo de slide", @@ -265,6 +269,7 @@ "app.leaveConfirmation.confirmLabel": "Sair", "app.leaveConfirmation.confirmDesc": "Sai da sessão", "app.endMeeting.title": "Terminar sessão", + "app.endMeeting.description": "Deseja fechar esta sessão para todos os participantes? (Todos os participantes serão removidos da sessão).", "app.endMeeting.yesLabel": "Sim", "app.endMeeting.noLabel": "Não", "app.about.title": "Sobre", @@ -541,6 +546,9 @@ "app.videoPreview.closeLabel": "Fechar", "app.videoPreview.findingWebcamsLabel": "À procura de webcams", "app.videoPreview.startSharingLabel": "Iniciar partilha", + "app.videoPreview.stopSharingLabel": "Parar a partilha", + "app.videoPreview.stopSharingAllLabel": "Parar tudo", + "app.videoPreview.sharedCameraLabel": "Esta webcam já está a ser partilhada", "app.videoPreview.webcamOptionLabel": "Escolher webcam", "app.videoPreview.webcamPreviewLabel": "Pré-visualização da webcam", "app.videoPreview.webcamSettingsTitle": "Configurações da webcam", @@ -583,6 +591,7 @@ "app.sfu.noAvailableCodec2203": "O servidor não foi capaz de encontrar o codec apropriado (erro 2203)", "app.meeting.endNotification.ok.label": "OK", "app.whiteboard.annotations.poll": "Os resultados da sondagem foram publicados", + "app.whiteboard.annotations.pollResult": "Resultado da Votação", "app.whiteboard.toolbar.tools": "Ferramentas", "app.whiteboard.toolbar.tools.hand": "Pan", "app.whiteboard.toolbar.tools.pencil": "Lápis", diff --git a/bigbluebutton-html5/private/locales/pt_BR.json b/bigbluebutton-html5/private/locales/pt_BR.json index a37c4bf8787a490920c582bc32773d38e09bbbc4..62b82be79f049bbad7e75a8e76fa07dabd8464ad 100644 --- a/bigbluebutton-html5/private/locales/pt_BR.json +++ b/bigbluebutton-html5/private/locales/pt_BR.json @@ -50,10 +50,10 @@ "app.note.title": "Notas compartilhadas", "app.note.label": "Nota", "app.note.hideNoteLabel": "Ocultar nota", + "app.note.tipLabel": "Pressione Esc para focar na barra de ferramentas do editor", "app.user.activityCheck": "Verificação de atividade do usuário", "app.user.activityCheck.label": "Verifica se o usuário ainda está na sala ({0})", "app.user.activityCheck.check": "Verificar", - "app.note.tipLabel": "Pressione Esc para focar na barra de ferramentas do editor", "app.userList.usersTitle": "Usuários", "app.userList.participantsTitle": "Participantes", "app.userList.messagesTitle": "Mensagens", diff --git a/bigbluebutton-html5/private/locales/ro_RO.json b/bigbluebutton-html5/private/locales/ro_RO.json index a616c0e4123c9b411c021cc86f3e7ac751bcd29e..16301f59622875799c5a7e1909ec4b2453ef283d 100644 --- a/bigbluebutton-html5/private/locales/ro_RO.json +++ b/bigbluebutton-html5/private/locales/ro_RO.json @@ -50,10 +50,10 @@ "app.note.title": "Notite partajate", "app.note.label": "Notite", "app.note.hideNoteLabel": "Ascunde notita", + "app.note.tipLabel": "Apasa Esc pentru editare bara de instrumente", "app.user.activityCheck": "Verificare activitate utilizator", "app.user.activityCheck.label": "Verific daca utilizatorul este inca in sedinta ({0})", "app.user.activityCheck.check": "Verific", - "app.note.tipLabel": "Apasa Esc pentru editare bara de instrumente", "app.userList.usersTitle": "Utilizatori", "app.userList.participantsTitle": "Participanti", "app.userList.messagesTitle": "Mesaje", diff --git a/bigbluebutton-html5/private/locales/ru.json b/bigbluebutton-html5/private/locales/ru.json index 2ba3f26e69de2d7a556f4a7d584d3ec6a13c620c..2d5505eb57a451207a21992a741ad496034d2faa 100644 --- a/bigbluebutton-html5/private/locales/ru.json +++ b/bigbluebutton-html5/private/locales/ru.json @@ -50,10 +50,10 @@ "app.note.title": "Общие заметки", "app.note.label": "Заметка", "app.note.hideNoteLabel": "СпрÑтать заметку", + "app.note.tipLabel": "Ðажмите Esc, чтобы ÑфокуÑировать панель инÑтрументов редактора", "app.user.activityCheck": "Проверка активноÑти пользователÑ", "app.user.activityCheck.label": "Проверить находитÑÑ Ð»Ð¸ пользователь в конференции ({0})", "app.user.activityCheck.check": "Проверка", - "app.note.tipLabel": "Ðажмите Esc, чтобы ÑфокуÑировать панель инÑтрументов редактора", "app.userList.usersTitle": "Пользователи", "app.userList.participantsTitle": "УчаÑтники", "app.userList.messagesTitle": "СообщениÑ", diff --git a/bigbluebutton-html5/private/locales/ru_RU.json b/bigbluebutton-html5/private/locales/ru_RU.json index 05e9eabee8b760e8261366b86cb2803bf22e2217..96e603b7c40932d9b4760c2158292606b6d20758 100644 --- a/bigbluebutton-html5/private/locales/ru_RU.json +++ b/bigbluebutton-html5/private/locales/ru_RU.json @@ -50,10 +50,10 @@ "app.note.title": "Общие заметки", "app.note.label": "Заметка", "app.note.hideNoteLabel": "СпрÑтать заметку", + "app.note.tipLabel": "Ðажмите Esc, чтобы ÑфокуÑировать панель инÑтрументов редактора", "app.user.activityCheck": "Проверка активноÑти пользователÑ", "app.user.activityCheck.label": "Проверить находитÑÑ Ð»Ð¸ пользователь в конференции ({0})", "app.user.activityCheck.check": "Проверка", - "app.note.tipLabel": "Ðажмите Esc, чтобы ÑфокуÑировать панель инÑтрументов редактора", "app.userList.usersTitle": "Пользователи", "app.userList.participantsTitle": "УчаÑтники", "app.userList.messagesTitle": "СообщениÑ", diff --git a/bigbluebutton-html5/private/locales/sk_SK.json b/bigbluebutton-html5/private/locales/sk_SK.json index 6081b8a7e6b5ecc7d102d117a5a39476d4c58da2..1418b650b6fd76f0a462e6ebf60bd228902f3287 100644 --- a/bigbluebutton-html5/private/locales/sk_SK.json +++ b/bigbluebutton-html5/private/locales/sk_SK.json @@ -50,10 +50,10 @@ "app.note.title": "Zdieľané poznámky", "app.note.label": "Poznámka", "app.note.hideNoteLabel": "SkryÅ¥ poznámku", + "app.note.tipLabel": "StlaÄte Esc pre vstup do liÅ¡ty nástrojov editora", "app.user.activityCheck": "Kontrola aktivÃt užÃvateľa", "app.user.activityCheck.label": "Kontrola, Äi je užÃvateľ pripojený ({0})", "app.user.activityCheck.check": "Kontrola", - "app.note.tipLabel": "StlaÄte Esc pre vstup do liÅ¡ty nástrojov editora", "app.userList.usersTitle": "UžÃvatelia", "app.userList.participantsTitle": "ÚÄastnÃci", "app.userList.messagesTitle": "Správy", diff --git a/bigbluebutton-html5/private/locales/sl.json b/bigbluebutton-html5/private/locales/sl.json index cff5da2017410001780bda59f8932b1ca8e3143d..ae2ba4bd8d3b06b8a9e8f80e3ce02b5df7753669 100644 --- a/bigbluebutton-html5/private/locales/sl.json +++ b/bigbluebutton-html5/private/locales/sl.json @@ -50,10 +50,10 @@ "app.note.title": "Skupne beležke", "app.note.label": "Beležka", "app.note.hideNoteLabel": "Skrij beležko", + "app.note.tipLabel": "Pritisnite tipko Esc za prikaz orodne vrstice urejevalnika", "app.user.activityCheck": "Preverjanje dejavnosti udeleženca", "app.user.activityCheck.label": "Preveri, ali je udeleženec Å¡e vedno prisoten ({0})", "app.user.activityCheck.check": "Preveri", - "app.note.tipLabel": "Pritisnite tipko Esc za prikaz orodne vrstice urejevalnika", "app.userList.usersTitle": "Udeleženci", "app.userList.participantsTitle": "Udeleženci", "app.userList.messagesTitle": "SporoÄila", diff --git a/bigbluebutton-html5/private/locales/sr.json b/bigbluebutton-html5/private/locales/sr.json index 36e2e1e965c1d9b3cc42371b914f7ad1ab564097..6fd613b10f2f57f09753cbde8bef24944f9977b2 100644 --- a/bigbluebutton-html5/private/locales/sr.json +++ b/bigbluebutton-html5/private/locales/sr.json @@ -50,10 +50,10 @@ "app.note.title": "BeleÅ¡ke za sve uÄesnike", "app.note.label": "BeleÅ¡ka", "app.note.hideNoteLabel": "Sklonite beleÅ¡ku", + "app.note.tipLabel": "Pritisnite dugme \"Esc\" kako biste uveliÄali meni za editovanje", "app.user.activityCheck": "Provera aktivnosti polaznika", "app.user.activityCheck.label": "Proverite da li je polaznik joÅ¡ uvek na predavanju ({0})", "app.user.activityCheck.check": "Provera", - "app.note.tipLabel": "Pritisnite dugme \"Esc\" kako biste uveliÄali meni za editovanje", "app.userList.usersTitle": "Polaznici", "app.userList.participantsTitle": "UÄesnici", "app.userList.messagesTitle": "Poruke", diff --git a/bigbluebutton-html5/private/locales/sv_SE.json b/bigbluebutton-html5/private/locales/sv_SE.json index 88c2c7647834551a0826f95953dbe17132ffa9c2..b7848811a579f8f4d736d9df570d9bc9cd6aaa6b 100644 --- a/bigbluebutton-html5/private/locales/sv_SE.json +++ b/bigbluebutton-html5/private/locales/sv_SE.json @@ -47,10 +47,10 @@ "app.note.title": "Delade notiser", "app.note.label": "Notis", "app.note.hideNoteLabel": "Göm notis", + "app.note.tipLabel": "Tryck pÃ¥ Esc för att fokusera redigeringsverktygsfältet", "app.user.activityCheck": "Användaraktivitetskontroll", "app.user.activityCheck.label": "Kontrollera om användaren fortfarande är i möte ({0})", "app.user.activityCheck.check": "Kontrollera", - "app.note.tipLabel": "Tryck pÃ¥ Esc för att fokusera redigeringsverktygsfältet", "app.userList.usersTitle": "Användare", "app.userList.participantsTitle": "Deltagare", "app.userList.messagesTitle": "Meddelanden", diff --git a/bigbluebutton-html5/private/locales/te.json b/bigbluebutton-html5/private/locales/te.json index a370597d9ade797eb4a48cdcc96c8ab5f4c0859f..ac8ab4c28b30c393c7391e8c00b9ffbd682e5a3d 100644 --- a/bigbluebutton-html5/private/locales/te.json +++ b/bigbluebutton-html5/private/locales/te.json @@ -50,10 +50,10 @@ "app.note.title": "షేరà±à°¡à± నోటà±à°¸à±", "app.note.label": "నోటà±", "app.note.hideNoteLabel": "నోటà±à°¨à± దాచండి", + "app.note.tipLabel": "ఎడిటరౠటూలà±â€Œà°¬à°¾à°°à±â€Œ పై దృషà±à°Ÿà°¿ పెటà±à°Ÿà°¡à°¾à°¨à°¿à°•à°¿ Esc నొకà±à°•à°‚à°¡à°¿", "app.user.activityCheck": "వినియోగదారà±à°¨à°¿ పనిని పరిశీలించండి", "app.user.activityCheck.label": "వినియోగదారà±à°¡à± ఇంకా సమావేశంలో ఉనà±à°¨à°¾à°°à±‹ లేదో పరిశీలించండి ({0})", "app.user.activityCheck.check": "పరిశీలించండి", - "app.note.tipLabel": "ఎడిటరౠటూలà±â€Œà°¬à°¾à°°à±â€Œ పై దృషà±à°Ÿà°¿ పెటà±à°Ÿà°¡à°¾à°¨à°¿à°•à°¿ Esc నొకà±à°•à°‚à°¡à°¿", "app.userList.usersTitle": "వినియోగదారà±à°²à±", "app.userList.participantsTitle": "పాలà±à°—ొనేవారà±", "app.userList.messagesTitle": "సందేశాలà±", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "మూసివేయి", "app.videoPreview.findingWebcamsLabel": "వెబà±â€Œà°•à±à°¯à°¾à°®à±â€Œà°²à°¨à± à°•à°¨à±à°—ొనడం", "app.videoPreview.startSharingLabel": "షేరింగౠచేయడం à°ªà±à°°à°¾à°°à°‚à°à°¿à°‚à°šà°‚à°¡à°¿", + "app.videoPreview.stopSharingLabel": "షేరౠచేయడం ఆపివేయండి", + "app.videoPreview.stopSharingAllLabel": "à°…à°¨à±à°¨à±€ ఆపివేయà±", + "app.videoPreview.sharedCameraLabel": "à°ˆ కెమెరా ఇపà±à°ªà°Ÿà°¿à°•ే షేరౠచేయబడà±à°¤à±‹à°‚ది", "app.videoPreview.webcamOptionLabel": "వెబà±â€Œà°•à±à°¯à°¾à°®à±â€Œà°¨à± à°Žà°‚à°šà±à°•ోండి", "app.videoPreview.webcamPreviewLabel": "వెబà±â€Œà°•à±à°¯à°¾à°®à± à°ªà±à°°à°¿à°µà±à°¯à±‚", "app.videoPreview.webcamSettingsTitle": "వెబà±â€Œà°•à±à°¯à°¾à°®à± సెటà±à°Ÿà°¿à°‚à°—à±à°²à±", @@ -588,6 +591,7 @@ "app.sfu.noAvailableCodec2203": "సరà±à°µà°°à± తగిన కోడెకà±â€Œà°¨à± à°•à°¨à±à°—ొనలేకపోయింది (లోపం 2203)", "app.meeting.endNotification.ok.label": "సరే", "app.whiteboard.annotations.poll": "పోలౠఫలితాలౠపà±à°°à°šà±à°°à°¿à°‚చబడà±à°¡à°¾à°¯à°¿", + "app.whiteboard.annotations.pollResult": "పోలౠఫలితం", "app.whiteboard.toolbar.tools": "పరికరమà±à°²à±", "app.whiteboard.toolbar.tools.hand": "పానà±", "app.whiteboard.toolbar.tools.pencil": "పెనà±à°¸à°¿à°²à±", diff --git a/bigbluebutton-html5/private/locales/th.json b/bigbluebutton-html5/private/locales/th.json index 2d29485a1354a0219efd41515f37811daf39753b..6f82f6173635acc2a333b7b6537f39e9736deec0 100644 --- a/bigbluebutton-html5/private/locales/th.json +++ b/bigbluebutton-html5/private/locales/th.json @@ -50,10 +50,10 @@ "app.note.title": "à¹à¸šà¹ˆà¸‡à¸›à¸±à¸™à¸‚้à¸à¸„วาม", "app.note.label": "ข้à¸à¸„วาม", "app.note.hideNoteLabel": "ซ่à¸à¸™à¸‚้à¸à¸„วาม", + "app.note.tipLabel": "à¸à¸” ESC สำหรับโฟà¸à¸±à¸ªà¹à¸–บเมนูà¹à¸à¹‰à¹„ข", "app.user.activityCheck": "ตรวจสà¸à¸šà¸à¸´à¸ˆà¸à¸£à¸£à¸¡à¸œà¸¹à¹‰à¹ƒà¸Šà¹‰à¸‡à¸²à¸™", "app.user.activityCheck.label": "ตรวจสà¸à¸šà¸§à¹ˆà¸²à¸œà¸¹à¹‰à¹ƒà¸Šà¹‰à¸¢à¸±à¸‡à¸à¸¢à¸¹à¹ˆà¹ƒà¸™à¸à¸²à¸£à¸›à¸£à¸°à¸Šà¸¸à¸¡à¸«à¸£à¸·à¸à¹„ม่ ({0})", "app.user.activityCheck.check": "ตรวจสà¸à¸š", - "app.note.tipLabel": "à¸à¸” ESC สำหรับโฟà¸à¸±à¸ªà¹à¸–บเมนูà¹à¸à¹‰à¹„ข", "app.userList.usersTitle": "ผู้ใช้งาน", "app.userList.participantsTitle": "ผู้เข้าร่วม", "app.userList.messagesTitle": "ข้à¸à¸„วาม", diff --git a/bigbluebutton-html5/private/locales/th_TH.json b/bigbluebutton-html5/private/locales/th_TH.json index f640c2330298023d7290404a98804e6cae659f31..46fbb12b4fa2c5996c2d2cafbbd92ae8ae234273 100644 --- a/bigbluebutton-html5/private/locales/th_TH.json +++ b/bigbluebutton-html5/private/locales/th_TH.json @@ -50,10 +50,10 @@ "app.note.title": "à¹à¸šà¹ˆà¸‡à¸›à¸±à¸™à¸‚้à¸à¸„วาม", "app.note.label": "ข้à¸à¸„วาม", "app.note.hideNoteLabel": "ซ่à¸à¸™à¸‚้à¸à¸„วาม", + "app.note.tipLabel": "à¸à¸” ESC สำหรับโฟà¸à¸±à¸ªà¹à¸–บเมนูà¹à¸à¹‰à¹„ข", "app.user.activityCheck": "ตรวจสà¸à¸šà¸à¸´à¸ˆà¸à¸£à¸£à¸¡à¸œà¸¹à¹‰à¹ƒà¸Šà¹‰à¸‡à¸²à¸™", "app.user.activityCheck.label": "ตรวจสà¸à¸šà¸§à¹ˆà¸²à¸œà¸¹à¹‰à¹ƒà¸Šà¹‰à¸¢à¸±à¸‡à¸à¸¢à¸¹à¹ˆà¹ƒà¸™à¸à¸²à¸£à¸›à¸£à¸°à¸Šà¸¸à¸¡à¸«à¸£à¸·à¸à¹„ม่ ({0})", "app.user.activityCheck.check": "ตรวจสà¸à¸š", - "app.note.tipLabel": "à¸à¸” ESC สำหรับโฟà¸à¸±à¸ªà¹à¸–บเมนูà¹à¸à¹‰à¹„ข", "app.userList.usersTitle": "ผู้ใช้งาน", "app.userList.participantsTitle": "ผู้เข้าร่วม", "app.userList.messagesTitle": "ข้à¸à¸„วาม", diff --git a/bigbluebutton-html5/private/locales/tr.json b/bigbluebutton-html5/private/locales/tr.json index cd7d6041eb9b3e6b2eef214a8e324dd188451c17..7496ea16a9181a9980fea1a8d037b5abf29dbae8 100644 --- a/bigbluebutton-html5/private/locales/tr.json +++ b/bigbluebutton-html5/private/locales/tr.json @@ -50,10 +50,10 @@ "app.note.title": "Paylaşılan Notlar", "app.note.label": "Not", "app.note.hideNoteLabel": "Notu gizle", + "app.note.tipLabel": "Düzenleyici araç çubuÄŸuna odaklanmak için Esc tuÅŸuna basın", "app.user.activityCheck": "Kullanıcı etkinliÄŸi denetimi", "app.user.activityCheck.label": "Kullanıcının hala toplantıda olup olmadığını denetleyin ({0})", "app.user.activityCheck.check": "Denetle", - "app.note.tipLabel": "Düzenleyici araç çubuÄŸuna odaklanmak için Esc tuÅŸuna basın", "app.userList.usersTitle": "Kullanıcılar", "app.userList.participantsTitle": "Katılımcılar", "app.userList.messagesTitle": "İletiler", diff --git a/bigbluebutton-html5/private/locales/tr_TR.json b/bigbluebutton-html5/private/locales/tr_TR.json index b4de865bf4746d9e0f7dea53145bbf2d1795b599..f81a337df5996a3759d8639e9d1dab35f66d0ef5 100644 --- a/bigbluebutton-html5/private/locales/tr_TR.json +++ b/bigbluebutton-html5/private/locales/tr_TR.json @@ -50,10 +50,10 @@ "app.note.title": "Paylaşılan Notlar", "app.note.label": "Not", "app.note.hideNoteLabel": "Notu gizle", + "app.note.tipLabel": "Editör araç çubuÄŸuna odaklanmak için Esc tuÅŸuna basın", "app.user.activityCheck": "Kullanıcı etkinliÄŸi kontrolü", "app.user.activityCheck.label": "Kullanıcının hala toplantıda olup olmadığını kontrol edin ({0})", "app.user.activityCheck.check": "Kontrol et", - "app.note.tipLabel": "Editör araç çubuÄŸuna odaklanmak için Esc tuÅŸuna basın", "app.userList.usersTitle": "Kullanıcılar", "app.userList.participantsTitle": "Katılımcılar", "app.userList.messagesTitle": "Mesajlar", diff --git a/bigbluebutton-html5/private/locales/uk_UA.json b/bigbluebutton-html5/private/locales/uk_UA.json index d9490f19c01331ef0a5abf299b0bd8bb70ecedff..c5b0a6ff671b3815ff254c1a211ddf71388647dd 100644 --- a/bigbluebutton-html5/private/locales/uk_UA.json +++ b/bigbluebutton-html5/private/locales/uk_UA.json @@ -50,10 +50,10 @@ "app.note.title": "Спільні нотатки", "app.note.label": "Ðотатки", "app.note.hideNoteLabel": "Сховати нотатки", + "app.note.tipLabel": "ÐатиÑніть Esc, щоб ÑфокуÑувати панель інÑтрументів редактора", "app.user.activityCheck": "Перевірка активноÑті учаÑника", "app.user.activityCheck.label": "Перевірте, чи учаÑник зараз на зуÑтрiчi ({0})", "app.user.activityCheck.check": "Перевірка", - "app.note.tipLabel": "ÐатиÑніть Esc, щоб ÑфокуÑувати панель інÑтрументів редактора", "app.userList.usersTitle": "УчаÑники", "app.userList.participantsTitle": "УчаÑники", "app.userList.messagesTitle": "ПовідомленнÑ", diff --git a/bigbluebutton-html5/private/locales/vi.json b/bigbluebutton-html5/private/locales/vi.json index e702e192ff12e5d34e0eff1470d9ef26edcd2fe1..d439214da39bfca24ffea25ebec12d80037d65c7 100644 --- a/bigbluebutton-html5/private/locales/vi.json +++ b/bigbluebutton-html5/private/locales/vi.json @@ -50,10 +50,10 @@ "app.note.title": "Chia sẻ ghi chú", "app.note.label": "Ghi chú", "app.note.hideNoteLabel": "Ẩn ghi chú", + "app.note.tipLabel": "Nhấn phÃm Esc để mở trình soạn thảo", "app.user.activityCheck": "Kiểm tra hoạt động cá»§a thà nh viên", "app.user.activityCheck.label": "Kiểm tra nếu thà nh viên vẫn Ä‘ang xem trò chuyện ({0})", "app.user.activityCheck.check": "Kiểm tra", - "app.note.tipLabel": "Nhấn phÃm Esc để mở trình soạn thảo", "app.userList.usersTitle": "Thà nh viên", "app.userList.participantsTitle": "Ngưá»i tham gia", "app.userList.messagesTitle": "Tin nhắn", diff --git a/bigbluebutton-html5/private/locales/vi_VN.json b/bigbluebutton-html5/private/locales/vi_VN.json index d7d7514b04cfe8a94bab6b94bc10da1b417ff087..617f93d18aa2bdf0fccc8d2a0b974151006251ef 100644 --- a/bigbluebutton-html5/private/locales/vi_VN.json +++ b/bigbluebutton-html5/private/locales/vi_VN.json @@ -50,10 +50,10 @@ "app.note.title": "Ghi chú chung", "app.note.label": "Ghi chú", "app.note.hideNoteLabel": "Ẩn ghi chú", + "app.note.tipLabel": "Nhấn ESC để chuyển ra thanh công cụ", "app.user.activityCheck": "Kiểm tra hoạt động ngưá»i dùng", "app.user.activityCheck.label": "Kiểm tra nếu ngưá»i dùng vẫn Ä‘ang trong cuá»™c há»p ({0})", "app.user.activityCheck.check": "Kiểm tra", - "app.note.tipLabel": "Nhấn ESC để chuyển ra thanh công cụ", "app.userList.usersTitle": "Ngưá»i dùng", "app.userList.participantsTitle": "Ngưá»i tham dá»±", "app.userList.messagesTitle": "Tin nhắn", diff --git a/bigbluebutton-html5/private/locales/zh_CN.json b/bigbluebutton-html5/private/locales/zh_CN.json index 83837ecb681adc0de55c89836f81ded58d349918..bc626232ed7b7a6d80d955a0455851c6a5e80f99 100644 --- a/bigbluebutton-html5/private/locales/zh_CN.json +++ b/bigbluebutton-html5/private/locales/zh_CN.json @@ -50,10 +50,10 @@ "app.note.title": "分享笔记", "app.note.label": "笔记", "app.note.hideNoteLabel": "éšè—ç¬”è®°é¢æ¿", + "app.note.tipLabel": "按Esc键定ä½åˆ°ç¼–辑器工具æ ", "app.user.activityCheck": "用户活动检查", "app.user.activityCheck.label": "确认用户是å¦ä»ç„¶ä¼šè®®ä¸ï¼ˆ{0})", "app.user.activityCheck.check": "检查", - "app.note.tipLabel": "按Esc键定ä½åˆ°ç¼–辑器工具æ ", "app.userList.usersTitle": "用户", "app.userList.participantsTitle": "å‚会者", "app.userList.messagesTitle": "消æ¯", diff --git a/bigbluebutton-html5/private/locales/zh_TW.json b/bigbluebutton-html5/private/locales/zh_TW.json index c5f7f31afb5af9a10a4a93be3776400577186f1f..d14c7878b9c4b0b4ad9ad2273e74a8c99fceb3f1 100644 --- a/bigbluebutton-html5/private/locales/zh_TW.json +++ b/bigbluebutton-html5/private/locales/zh_TW.json @@ -50,10 +50,10 @@ "app.note.title": "共享ç†è¨˜", "app.note.label": "ç†è¨˜", "app.note.hideNoteLabel": "éš±è—ç†è¨˜", + "app.note.tipLabel": "壓Escéµèšç„¦ç·¨è¼¯å™¨å·¥å…·åˆ—", "app.user.activityCheck": "用戶活動檢查", "app.user.activityCheck.label": "檢查用戶是å¦ä»åœ¨æœƒè°ä¸ ({0})", "app.user.activityCheck.check": "檢查", - "app.note.tipLabel": "壓Escéµèšç„¦ç·¨è¼¯å™¨å·¥å…·åˆ—", "app.userList.usersTitle": "用戶", "app.userList.participantsTitle": "åƒèˆ‡è€…", "app.userList.messagesTitle": "訊æ¯", @@ -546,6 +546,9 @@ "app.videoPreview.closeLabel": "關閉", "app.videoPreview.findingWebcamsLabel": "尋找網路æ”å½±è£ç½®", "app.videoPreview.startSharingLabel": "開始分享", + "app.videoPreview.stopSharingLabel": "åœæ¢åˆ†äº«", + "app.videoPreview.stopSharingAllLabel": "å…¨éƒ¨åœæ¢", + "app.videoPreview.sharedCameraLabel": "這個æ”影機已分享了", "app.videoPreview.webcamOptionLabel": "鏿“‡ç¶²è·¯æ”影機", "app.videoPreview.webcamPreviewLabel": "網路æ”影機é 覽", "app.videoPreview.webcamSettingsTitle": "網路æ”影機è¨å®š", @@ -588,6 +591,7 @@ "app.sfu.noAvailableCodec2203": "伺æœå™¨ç„¡æ³•找到åˆé©çš„編解碼器 (錯誤 2203)", "app.meeting.endNotification.ok.label": "確定", "app.whiteboard.annotations.poll": "å…¬ä½ˆæŠ•ç¥¨èª¿æ•´çµæžœ", + "app.whiteboard.annotations.pollResult": "æŠ•ç¥¨çµæžœ", "app.whiteboard.toolbar.tools": "工具", "app.whiteboard.toolbar.tools.hand": "移動", "app.whiteboard.toolbar.tools.pencil": "ç†", diff --git a/bigbluebutton-html5/tests/puppeteer/all.test.js b/bigbluebutton-html5/tests/puppeteer/all.test.js new file mode 100644 index 0000000000000000000000000000000000000000..bf27d988bc4c38750cb5fd6ad70c821a3c7870b4 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/all.test.js @@ -0,0 +1,27 @@ +const audioTest = require('./audio.obj'); +const chatTest = require('./chat.obj'); +const breakoutTest = require('./breakout.obj'); +const customParametersTest = require('./customparameters.obj'); +const notificationsTest = require('./notifications.obj'); +const presentationTest = require('./presentation.obj'); +const screenShareTest = require('./screenshare.obj'); +const sharedNotesTest = require('./sharednotes.obj'); +const userTest = require('./user.obj'); +const virtualizedListTest = require('./virtualizedlist.obj'); +const webcamTest = require('./webcam.obj'); +const whiteboardTest = require('./whiteboard.obj'); + +process.setMaxListeners(Infinity); + +describe('Audio', audioTest); +describe('Chat', chatTest); +describe('Breakout', breakoutTest); +describe('Custom Parameters', customParametersTest); +describe('Notifications', notificationsTest); +describe('Presentation', presentationTest); +describe('Screen Share', screenShareTest); +describe('Shared Notes ', sharedNotesTest); +describe('User', userTest); +describe('Virtualized List', virtualizedListTest); +describe('Webcam', webcamTest); +describe('Whiteboard', whiteboardTest); diff --git a/bigbluebutton-html5/tests/puppeteer/audio.obj.js b/bigbluebutton-html5/tests/puppeteer/audio.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..9470f7afbd0ec10b9332b3f9d925479234f02360 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/audio.obj.js @@ -0,0 +1,38 @@ +const Audio = require('./audio/audio'); +const Page = require('./core/page'); + +const audioTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Join audio with Listen Only', async () => { + const test = new Audio(); + let response; + try { + await test.init(Page.getArgsWithAudio()); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Join audio with Microphone', async () => { + const test = new Audio(); + let response; + try { + await test.init(Page.getArgsWithAudio()); + response = await test.microphone(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; + +module.exports = exports = audioTest; diff --git a/bigbluebutton-html5/tests/puppeteer/audio.test.js b/bigbluebutton-html5/tests/puppeteer/audio.test.js index fa0e3c0a991526f704016af6535eba14db0df888..7316567675dac4c6c67bbe383575b211b208a802 100644 --- a/bigbluebutton-html5/tests/puppeteer/audio.test.js +++ b/bigbluebutton-html5/tests/puppeteer/audio.test.js @@ -1,36 +1,3 @@ -const Audio = require('./audio/audio'); -const Page = require('./core/page'); +const audioTest = require('./audio.obj'); -describe('Audio', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Join audio with Listen Only', async () => { - const test = new Audio(); - let response; - try { - await test.init(Page.getArgsWithAudio()); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Join audio with Microphone', async () => { - const test = new Audio(); - let response; - try { - await test.init(Page.getArgsWithAudio()); - response = await test.microphone(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Audio', audioTest); diff --git a/bigbluebutton-html5/tests/puppeteer/breakout.obj.js b/bigbluebutton-html5/tests/puppeteer/breakout.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..4e1bb169323d7b6f8e2bb0f99ba27aca369c57a4 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/breakout.obj.js @@ -0,0 +1,99 @@ +const Join = require('./breakout/join'); +const Create = require('./breakout/create'); +const Page = require('./core/page'); + +const breakoutTest = () => { + beforeEach(() => { + jest.setTimeout(150000); + }); + + // // Create Breakout Room + // test('Create Breakout room', async () => { + // const test = new Create(); + // let response; + // try { + // const testName = 'createBreakoutrooms'; + // await test.init(undefined); + // await test.create(testName); + // response = await test.testCreatedBreakout(testName); + // } catch (e) { + // console.log(e); + // } finally { + // await test.close(); + // } + // expect(response).toBe(true); + // }); + + // // Join Breakout Room + // test('Join Breakout room', async () => { + // const test = new Join(); + // let response; + // try { + // const testName = 'joinBreakoutroomsWithoutFeatures'; + // await test.init(undefined); + // await test.create(testName); + // await test.join(testName); + // response = await test.testJoined(testName); + // } catch (e) { + // console.log(e); + // } finally { + // await test.close(); + // } + // expect(response).toBe(true); + // }); + + // // Join Breakout Room with Video + // test('Join Breakout room with Video', async () => { + // const test = new Join(); + // let response; + // try { + // const testName = 'joinBreakoutroomsWithVideo'; + // await test.init(undefined); + // await test.create(testName); + // await test.join(testName); + // response = await test.testJoined(testName); + // } catch (e) { + // console.log(e); + // } finally { + // await test.close(); + // } + // expect(response).toBe(true); + // }); + + // // Join Breakout Room and start Screen Share + // test('Join Breakout room and share screen', async () => { + // const test = new Join(); + // let response; + // try { + // const testName = 'joinBreakoutroomsAndShareScreen'; + // await test.init(undefined); + // await test.create(testName); + // await test.join(testName); + // response = await test.testJoined(testName); + // } catch (e) { + // console.log(e); + // } finally { + // await test.close(); + // } + // expect(response).toBe(true); + // }); + + // Join Breakout Room with Audio + test('Join Breakout room with Audio', async () => { + const test = new Join(); + let response; + try { + const testName = 'joinBreakoutroomsWithAudio'; + await test.init(undefined); + await test.create(testName); + await test.join(testName); + response = await test.testJoined(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = breakoutTest; diff --git a/bigbluebutton-html5/tests/puppeteer/breakout.test.js b/bigbluebutton-html5/tests/puppeteer/breakout.test.js index 4e335bea854da31c38984bed6a5d49065b020135..e8106562cd81338e0b984139cfa25e8560ea46e4 100644 --- a/bigbluebutton-html5/tests/puppeteer/breakout.test.js +++ b/bigbluebutton-html5/tests/puppeteer/breakout.test.js @@ -1,98 +1,3 @@ -const Join = require('./breakout/join'); -const Create = require('./breakout/create'); -const Page = require('./core/page'); +const breakoutTest = require('./breakout.obj'); -describe('Breakoutrooms', () => { - beforeEach(() => { - jest.setTimeout(150000); - }); - - // Create Breakout Room - test('Create Breakout room', async () => { - const test = new Create(); - let response; - try { - const testName = 'createBreakoutrooms'; - await test.init(undefined); - await test.create(testName); - response = await test.testCreatedBreakout(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - // Join Breakout Room - test('Join Breakout room', async () => { - const test = new Join(); - let response; - try { - const testName = 'joinBreakoutroomsWithoutFeatures'; - await test.init(undefined); - await test.create(testName); - await test.join(testName); - response = await test.testJoined(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - // Join Breakout Room with Video - test('Join Breakout room with Video', async () => { - const test = new Join(); - let response; - try { - const testName = 'joinBreakoutroomsWithVideo'; - await test.init(undefined); - await test.create(testName); - await test.join(testName); - response = await test.testJoined(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - // Join Breakout Room and start Screen Share - test('Join Breakout room and share screen', async () => { - const test = new Join(); - let response; - try { - const testName = 'joinBreakoutroomsAndShareScreen'; - await test.init(undefined); - await test.create(testName); - await test.join(testName); - response = await test.testJoined(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - // Join Breakout Room with Audio - test('Join Breakout room with Audio', async () => { - const test = new Join(); - let response; - try { - const testName = 'joinBreakoutroomsWithAudio'; - await test.init(undefined); - await test.create(testName); - await test.join(testName); - response = await test.testJoined(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Breakout', breakoutTest); diff --git a/bigbluebutton-html5/tests/puppeteer/breakout/create.js b/bigbluebutton-html5/tests/puppeteer/breakout/create.js index 5282281478a96fbdf1b4dd6bad2f034cece3e076..402901fb33352d24f2f6ab0477c29ff0f825c62d 100644 --- a/bigbluebutton-html5/tests/puppeteer/breakout/create.js +++ b/bigbluebutton-html5/tests/puppeteer/breakout/create.js @@ -25,44 +25,62 @@ class Create { // Create Breakoutrooms async create(testName) { - await this.page1.screenshot(`${testName}`, `01-page01-initialized-${testName}`); - await this.page2.screenshot(`${testName}`, `01-page02-initialized-${testName}`); - this.page1.logger('page01 initialized'); - this.page2.logger('page02 initialized'); + await this.page1.closeAudioModal(); + await this.page2.closeAudioModal(); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `01-page01-initialized-${testName}`); + await this.page2.screenshot(`${testName}`, `01-page02-initialized-${testName}`); + } await this.page1.page.evaluate(util.clickTestElement, be.manageUsers); await this.page1.page.evaluate(util.clickTestElement, be.createBreakoutRooms); - this.page1.logger('page01 breakout rooms menu loaded'); - await this.page1.screenshot(`${testName}`, `02-page01-creating-breakoutrooms-${testName}`); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `02-page01-creating-breakoutrooms-${testName}`); + } await this.page1.waitForSelector(be.randomlyAssign); await this.page1.page.evaluate(util.clickTestElement, be.randomlyAssign); - this.page1.logger('page01 randomly assigned users'); - await this.page1.screenshot(`${testName}`, `03-page01-randomly-assign-user-${testName}`); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `03-page01-randomly-assign-user-${testName}`); + } await this.page1.waitForSelector(be.modalConfirmButton); await this.page1.page.evaluate(util.clickTestElement, be.modalConfirmButton); - this.page1.logger('page01 breakout rooms creation confirmed'); - await this.page1.screenshot(`${testName}`, `04-page01-confirm-breakoutrooms-creation-${testName}`); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `04-page01-confirm-breakoutrooms-creation-${testName}`); + } await this.page2.waitForSelector(be.modalConfirmButton); await this.page2.page.evaluate(util.clickTestElement, be.modalConfirmButton); - this.page2.logger('page02 breakout rooms join confirmed'); - await this.page2.screenshot(`${testName}`, `02-page02-accept-invite-breakoutrooms-${testName}`); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page2.screenshot(`${testName}`, `02-page02-accept-invite-breakoutrooms-${testName}`); + } + await this.page2.page.bringToFront(); + await this.page2.waitForSelector(be.breakoutRoomsItem); + await this.page2.waitForSelector(be.chatButton); + await this.page2.click(be.chatButton); + await this.page2.click(be.breakoutRoomsItem); + await this.page2.waitForSelector(be.alreadyConnected); const page2 = await this.page2.browser.pages(); - this.page2.logger('before closing audio modal'); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/03-breakout-page02-before-closing-audio-modal.png`) }); - await this.page2.waitForBreakoutElement('button[aria-label="Close Join audio modal"]', 2); - await this.page2.clickBreakoutElement('button[aria-label="Close Join audio modal"]', 2); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/04-breakout-page02-after-closing-audio-modal.png`) }); - this.page2.logger('audio modal closed'); + await page2[2].bringToFront(); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/03-breakout-page02-before-closing-audio-modal.png`) }); + } + await page2[2].waitForSelector('button[aria-label="Close Join audio modal"]'); + await page2[2].click('button[aria-label="Close Join audio modal"]'); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/04-breakout-page02-after-closing-audio-modal.png`) }); + } } // Check if Breakoutrooms have been created async testCreatedBreakout(testName) { const resp = await this.page1.page.evaluate(() => document.querySelectorAll('div[data-test="breakoutRoomsItem"]').length !== 0); if (resp === true) { - await this.page1.screenshot(`${testName}`, `05-page01-success-${testName}`); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `05-page01-success-${testName}`); + } return true; } - await this.page1.screenshot(`${testName}`, `05-page01-fail-${testName}`); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.page1.screenshot(`${testName}`, `05-page01-fail-${testName}`); + } return false; } @@ -73,13 +91,23 @@ class Create { await this.page3.closeAudioModal(); await this.page3.waitForSelector(be.breakoutRoomsButton); await this.page3.click(be.breakoutRoomsButton, true); + + await this.page3.waitForSelector(be.breakoutRoomsItem); + await this.page3.waitForSelector(be.chatButton); + await this.page3.click(be.chatButton); + await this.page3.click(be.breakoutRoomsItem); + + await this.page3.waitForSelector(be.joinRoom1); await this.page3.click(be.joinRoom1, true); await this.page3.waitForSelector(be.alreadyConnected); const page3 = await this.page3.browser.pages(); - await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-no-mic-before-check-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-no-mic-before-check-${testName}.png`) }); + } + await page3[2].bringToFront(); await page3[2].waitForSelector(ae.microphone); await page3[2].click(ae.microphone); await page3[2].waitForSelector(ae.connectingStatus); @@ -87,9 +115,9 @@ class Create { await page3[2].click(ae.audioAudible); await page3[2].waitForSelector(e.whiteboard); - await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-mic-before-check-${testName}.png`) }); - - this.page3.logger('joined breakout with audio'); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-mic-before-check-${testName}.png`) }); + } } else if (testName === 'joinBreakoutroomsWithVideo') { await this.page3.init(Page.getArgsWithVideo(), this.page1.meetingId, { ...params, fullName: 'Moderator3' }, undefined); await this.page3.closeAudioModal(); @@ -101,7 +129,10 @@ class Create { const page3 = await this.page3.browser.pages(); - await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-no-webcam-before-check-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-no-webcam-before-check-${testName}.png`) }); + } + await page3[2].bringToFront(); await page3[2].waitForSelector(e.audioDialog); await page3[2].waitForSelector(e.closeAudio); await page3[2].click(e.closeAudio); @@ -111,9 +142,9 @@ class Create { await page3[2].click(we.videoPreview); await page3[2].waitForSelector(we.startSharingWebcam); await page3[2].click(we.startSharingWebcam); - await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-webcam-before-check-${testName}.png`) }); - - this.page3.logger('joined breakout with video'); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-webcam-before-check-${testName}.png`) }); + } } else if (testName === 'joinBreakoutroomsAndShareScreen') { await this.page3.init(Page.getArgs(), this.page1.meetingId, { ...params, fullName: 'Moderator3' }, undefined); await this.page3.closeAudioModal(); @@ -124,6 +155,10 @@ class Create { await this.page3.waitForSelector(be.alreadyConnected); const page3 = await this.page3.browser.pages(); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-screenshare-before-check-${testName}.png`) }); + } + await page3[2].bringToFront(); await page3[2].waitForSelector(e.audioDialog); await page3[2].waitForSelector(e.closeAudio); await page3[2].click(e.closeAudio); @@ -140,18 +175,12 @@ class Create { await page3[2].on('dialog', async (dialog) => { await dialog.accept(); }); - - this.page3.logger('joined breakout and started screen share'); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page3[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/00-breakout-page03-user-joined-with-screenshare-after-check-${testName}.png`) }); + } } else { await this.page3.init(Page.getArgs(), this.page1.meetingId, { ...params, fullName: 'Moderator3' }, undefined); await this.page3.closeAudioModal(); - await this.page3.waitForSelector(be.breakoutRoomsButton); - await this.page3.click(be.breakoutRoomsButton, true); - await this.page3.waitForSelector(be.joinRoom1); - await this.page3.click(be.joinRoom1, true); - await this.page3.waitForSelector(be.alreadyConnected); - - this.page3.logger('joined breakout without use of any feature'); } } diff --git a/bigbluebutton-html5/tests/puppeteer/breakout/elements.js b/bigbluebutton-html5/tests/puppeteer/breakout/elements.js index 3d96da32e8e7c445ac74c3b90559dc64eee74c19..997d68b159920a60e10f785493b25dcfa2045249 100644 --- a/bigbluebutton-html5/tests/puppeteer/breakout/elements.js +++ b/bigbluebutton-html5/tests/puppeteer/breakout/elements.js @@ -10,3 +10,4 @@ exports.breakoutJoin = '[data-test="breakoutJoin"]'; exports.userJoined = 'div[aria-label^="Moderator3"]'; exports.breakoutRoomsButton = 'div[aria-label="Breakout Rooms"]'; exports.joinRoom1 = 'button[aria-label="Join room 1"]'; +exports.chatButton = 'div[data-test="chatButton"]'; diff --git a/bigbluebutton-html5/tests/puppeteer/breakout/join.js b/bigbluebutton-html5/tests/puppeteer/breakout/join.js index 39734d17b83fb220b4fd429c54f1cf610a06b54e..7428974b1cc81cb988b7dbd02c5564438b50faca 100644 --- a/bigbluebutton-html5/tests/puppeteer/breakout/join.js +++ b/bigbluebutton-html5/tests/puppeteer/breakout/join.js @@ -16,15 +16,7 @@ class Join extends Create { // Join Existing Breakoutrooms async join(testName) { - if (testName === 'joinBreakoutroomsWithAudio') { - await this.joinWithUser3(testName); - } else if (testName === 'joinBreakoutroomsWithVideo') { - await this.joinWithUser3(testName); - } else if (testName === 'joinBreakoutroomsAndShareScreen') { - await this.joinWithUser3(testName); - } else { - await this.joinWithUser3(testName); - } + await this.joinWithUser3(testName); } // Check if User Joined in Breakoutrooms @@ -35,14 +27,23 @@ class Join extends Create { this.page3.logger('logged in to breakout with audio'); const page2 = await this.page2.browser.pages(); - await page2[2].waitForSelector(pe.isTalking); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-with-audio-before-check-${testName}.png`) }); + + await page2[2].bringToFront(); + + // Talking indicator bar + await page2[2].waitForSelector('div[class^="isTalkingWrapper--"] > div[class^="speaking--"]'); + + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-with-audio-before-check-${testName}.png`) }); + } this.page3.logger('before pages check'); const respTalkingIndicatorElement = await page2[2].evaluate(util.getTestElement, pe.isTalking); const resp = respTalkingIndicatorElement === true; - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-with-audio-after-check-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-with-audio-after-check-${testName}.png`) }); + } this.page3.logger('after pages check'); return resp; } catch (e) { @@ -53,13 +54,17 @@ class Join extends Create { const page2 = await this.page2.browser.pages(); await page2[2].waitForSelector(we.videoContainer); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-with-webcam-success-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-with-webcam-success-${testName}.png`) }); + } this.page2.logger('before pages check'); const respWebcamElement = await page2[2].evaluate(util.getTestElement, we.videoContainer); const resp = respWebcamElement === true; - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-webcam-before-check-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-webcam-before-check-${testName}.png`) }); + } this.page2.logger('after pages check'); return resp; } else if (testName === 'joinBreakoutroomsAndShareScreen') { @@ -67,24 +72,26 @@ class Join extends Create { const page2 = await this.page2.browser.pages(); await page2[2].waitForSelector(pe.screenShareVideo); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-webcam-after-check-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-webcam-after-check-${testName}.png`) }); + } this.page2.logger('before pages check'); const resp = await page2[2].evaluate(async () => { const screenshareContainerElement = await document.querySelectorAll('video[id="screenshareVideo"]').length !== 0; return screenshareContainerElement === true; }); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-with-webcam-success-${testName}.png`) }); + if (process.env.GENERATE_EVIDENCES === 'true') { + await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-with-webcam-success-${testName}.png`) }); + } this.page2.logger('after pages check'); return resp; } else { - const page2 = await this.page2.browser.pages(); - await page2[2].waitForSelector(e.userJoined); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/05-breakout-page02-user-joined-before-check-${testName}.png`) }); - const resp = await page2[2].evaluate(async () => { - const foundUserElement = await document.querySelectorAll('div[aria-label^="Moderator3"]').length !== 0; - return foundUserElement; - }); - await page2[2].screenshot({ path: path.join(__dirname, `../${process.env.TEST_FOLDER}/test-${today}-${testName}/screenshots/06-breakout-page02-user-joined-after-check-${testName}.png`) }); + await this.page3.page.bringToFront(); + await this.page3.waitForSelector(e.breakoutRoomsItem); + await this.page3.waitForSelector(e.chatButton); + await this.page3.click(e.chatButton); + await this.page3.click(e.breakoutRoomsItem); + const resp = await this.page3.page.evaluate(async () => await document.querySelectorAll('span[class^="alreadyConnected--"]') !== null); return resp; } } diff --git a/bigbluebutton-html5/tests/puppeteer/chat.obj.js b/bigbluebutton-html5/tests/puppeteer/chat.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..5c6e213ccfbbbfc4a749645a032d936c7f507801 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/chat.obj.js @@ -0,0 +1,111 @@ +const Page = require('./core/page'); +const Send = require('./chat/send'); +const Clear = require('./chat/clear'); +const Copy = require('./chat/copy'); +const Save = require('./chat/save'); +const MultiUsers = require('./user/multiusers'); + +const chatTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Send message', async () => { + const test = new Send(); + let response; + try { + const testName = 'sendChat'; + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Clear chat', async () => { + const test = new Clear(); + let response; + try { + const testName = 'clearChat'; + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Copy chat', async () => { + const test = new Copy(); + let response; + try { + const testName = 'copyChat'; + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Save chat', async () => { + const test = new Save(); + let response; + try { + const testName = 'saveChat'; + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Send private chat to other User', async () => { + const test = new MultiUsers(); + let response; + try { + const testName = 'sendPrivateChat'; + await test.init(); + await test.page1.closeAudioModal(); + await test.page2.closeAudioModal(); + response = await test.multiUsersPrivateChat(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); + + test('Send public chat', async () => { + const test = new MultiUsers(); + let response; + try { + const testName = 'sendPublicChat'; + await test.init(); + await test.page1.closeAudioModal(); + await test.page2.closeAudioModal(); + response = await test.multiUsersPublicChat(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = chatTest; diff --git a/bigbluebutton-html5/tests/puppeteer/chat.test.js b/bigbluebutton-html5/tests/puppeteer/chat.test.js index 67360c2b9299ec548800f2a2720f10a89ebc836f..1fe00e4ad551a2b1020cc9cab7392551bb4550c4 100644 --- a/bigbluebutton-html5/tests/puppeteer/chat.test.js +++ b/bigbluebutton-html5/tests/puppeteer/chat.test.js @@ -1,104 +1,3 @@ -const Page = require('./core/page'); -const Send = require('./chat/send'); -const Clear = require('./chat/clear'); -const Copy = require('./chat/copy'); -const Save = require('./chat/save'); -const MultiUsers = require('./user/multiusers'); +const chatTest = require('./chat.obj'); -describe('Chat', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Send message', async () => { - const test = new Send(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Clear chat', async () => { - const test = new Clear(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Copy chat', async () => { - const test = new Copy(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Save chat', async () => { - const test = new Save(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Send private chat to other User', async () => { - const test = new MultiUsers(); - let response; - try { - await test.init(); - await test.page1.closeAudioModal(); - await test.page2.closeAudioModal(); - response = await test.multiUsersPrivateChat(); - } catch (e) { - console.log(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); - - test('Send public chat', async () => { - const test = new MultiUsers(); - let response; - try { - await test.init(); - await test.page1.closeAudioModal(); - await test.page2.closeAudioModal(); - response = await test.multiUsersPublicChat(); - } catch (e) { - console.log(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); -}); +describe('Chat', chatTest); diff --git a/bigbluebutton-html5/tests/puppeteer/chat/clear.js b/bigbluebutton-html5/tests/puppeteer/chat/clear.js index bf7f31837efbb0c786c275f7ceb4973e36cc3963..1639eff1285ab2cd66c643313343d33b670709cc 100644 --- a/bigbluebutton-html5/tests/puppeteer/chat/clear.js +++ b/bigbluebutton-html5/tests/puppeteer/chat/clear.js @@ -3,39 +3,44 @@ const Page = require('../core/page'); const e = require('./elements'); const util = require('./util'); +const { chatPushAlerts } = require('../notifications/elements'); class Clear extends Page { constructor() { super('chat-clear'); } - async test() { + async test(testName) { await util.openChat(this); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `01-before-chat-message-send-[${testName}]`); + } // sending a message await this.type(e.chatBox, e.message); await this.click(e.sendButton); - await this.screenshot(true); - // const before = await util.getTestElements(this); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `02-after-chat-message-send-[${testName}]`); + } - // 1 message - const chat0 = await this.page.$$(`${e.chatUserMessage} ${e.chatMessageText}`); + const chat0 = await this.page.evaluate(() => document.querySelectorAll('[data-test="chatUserMessage"]').length !== 0); // clear await this.click(e.chatOptions); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `03-chat-options-clicked-[${testName}]`); + } await this.click(e.chatClear, true); - await this.screenshot(true); - - // const after = await util.getTestElements(this); - - // 1 message - const chat1 = await this.page.$$(`${e.chatUserMessage} ${e.chatMessageText}`); - - expect(await chat0[0].evaluate(n => n.innerText)).toBe(e.message); + await this.page.waitForFunction( + 'document.querySelector("body").innerText.includes("The public chat history was cleared by a moderator")', + ); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `04-chat-cleared-[${testName}]`); + } - const response = chat0.length === 1 && chat1.length === 0; + const chat1 = await this.page.evaluate(() => document.querySelectorAll('[data-test="chatUserMessage"]').length !== 0); + const response = chat0 === true && chat1 === false; return response; } } diff --git a/bigbluebutton-html5/tests/puppeteer/chat/copy.js b/bigbluebutton-html5/tests/puppeteer/chat/copy.js index 849b6030c79d1d3ac47e0b94c51fc7bf06a69ff2..8d77255c9b152c8aebdd8997ea5348907fd17d3c 100644 --- a/bigbluebutton-html5/tests/puppeteer/chat/copy.js +++ b/bigbluebutton-html5/tests/puppeteer/chat/copy.js @@ -10,20 +10,28 @@ class Copy extends Page { super('chat-copy'); } - async test() { + async test(testName) { await util.openChat(this); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `01-before-sending-chat-message-[${testName}]`); + } // sending a message await this.type(e.chatBox, e.message); await this.click(e.sendButton); - await this.screenshot(true); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `02-chat-message-sent-[${testName}]`); + } await this.click(e.chatOptions); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `03-chat-options-clicked-[${testName}]`); + } await this.click(e.chatCopy, true); - const copiedChat = clipboardy.readSync(); - - return copiedChat.includes(`User1 : ${e.message}`); + // enable access to browser context clipboard + const context = await this.browser.defaultBrowserContext(); + await context.overridePermissions(process.env.BBB_SERVER_URL, ['clipboard-read']); + const copiedText = await this.page.evaluate(async () => await navigator.clipboard.readText()); + return copiedText.includes(`User1 : ${e.message}`); } } diff --git a/bigbluebutton-html5/tests/puppeteer/chat/save.js b/bigbluebutton-html5/tests/puppeteer/chat/save.js index ee3e04f832a4e4e7b86376a0c56713d907aaa3bf..b55b19948744967ee2fac5e52256d7765d276d2b 100644 --- a/bigbluebutton-html5/tests/puppeteer/chat/save.js +++ b/bigbluebutton-html5/tests/puppeteer/chat/save.js @@ -9,10 +9,15 @@ class Save extends Page { super('chat-save'); } - async test() { + async test(testName) { await util.openChat(this); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `01-before-chat-options-click-[${testName}]`); + } await this.click(e.chatOptions); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `02-chat-options-clicked-[${testName}]`); + } await this.click(e.chatSave, true); let clicked = ''; clicked = await this.page.addListener('click', () => document.addEventListener('click')); diff --git a/bigbluebutton-html5/tests/puppeteer/chat/send.js b/bigbluebutton-html5/tests/puppeteer/chat/send.js index dcc52609b9e7d324a0f47adf04a33ac48228eb78..52bb99bd6cf787d7e8be539b2ce4dc99a569f6e8 100644 --- a/bigbluebutton-html5/tests/puppeteer/chat/send.js +++ b/bigbluebutton-html5/tests/puppeteer/chat/send.js @@ -9,26 +9,26 @@ class Send extends Page { super('chat-send'); } - async test() { + async test(testName) { await util.openChat(this); - // const chat0 = await util.getTestElements(this); - // 0 messages const chat0 = await this.page.$$(`${e.chatUserMessage} ${e.chatMessageText}`); - + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `01-before-chat-message-send-[${testName}]`); + } // send a message await this.type(e.chatBox, e.message); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `02-typing-chat-message-[${testName}]`); + } await this.click(e.sendButton); - await this.screenshot(true); - - // const chat1 = await util.getTestElements(this); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `03-after-chat-message-send-[${testName}]`); + } // 1 message const chat1 = await this.page.$$(`${e.chatUserMessage} ${e.chatMessageText}`); - - expect(await chat1[0].evaluate(n => n.innerText)).toBe(e.message); - const response = chat0.length === 0 && chat1.length === 1; return response; diff --git a/bigbluebutton-html5/tests/puppeteer/customparameters.obj.js b/bigbluebutton-html5/tests/puppeteer/customparameters.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..5b3c7485a13a2d57bf4709646f2fe390ed03a3f7 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/customparameters.obj.js @@ -0,0 +1,433 @@ +const Page = require('./core/page'); +const CustomParameters = require('./customparameters/customparameters'); +const c = require('./customparameters/constants'); +const util = require('./customparameters/util'); + +const customParametersTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + // This test spec sets the userdata-autoJoin parameter to false + // and checks that the users don't get audio modal on login + test('Auto join', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'autoJoin'; + response = await test.autoJoin(testName, Page.getArgs(), undefined, c.autoJoin); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-listenOnlyMode parameter to false + // and checks that the users can't see or use listen Only mode + test('Listen Only Mode', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'listenOnlyMode'; + response = await test.listenOnlyMode(testName, Page.getArgsWithAudio(), undefined, c.listenOnlyMode); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-forceListenOnly parameter to false + // and checks that the Viewers can only use listen only mode + test('Force Listen Only', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'forceListenOnly'; + response = await test.forceListenOnly(testName, Page.getArgsWithAudio(), undefined, c.forceListenOnly); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page2); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-skipCheck parameter to true + // and checks that the users automatically skip audio check when clicking on Microphone + test('Skip audio check', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'skipCheck'; + response = await test.skipCheck(testName, Page.getArgsWithAudio(), undefined, c.skipCheck); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-clientTitle parameter to some value + // and checks that the meeting window name starts with that value + test('Client title', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'clientTitle'; + response = await test.clientTitle(testName, Page.getArgs(), undefined, c.clientTitle); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-askForFeedbackOnLogout parameter to true + // and checks that the users automatically get asked for feedback on logout page + test('Ask For Feedback On Logout', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'askForFeedbackOnLogout'; + response = await test.askForFeedbackOnLogout(testName, Page.getArgs(), undefined, c.askForFeedbackOnLogout); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-displayBrandingArea parameter to true and add a logo link + // and checks that the users see the logo displaying in the meeting + test('Display Branding Area', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'displayBrandingArea'; + const parameterWithLogo = `${c.displayBrandingArea}&${c.logo}`; + response = await test.displayBrandingArea(testName, Page.getArgs(), undefined, parameterWithLogo); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-shortcuts parameter to one or a list of shortcuts parameters + // and checks that the users can use those shortcuts + test('Shortcuts', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'shortcuts'; + response = await test.shortcuts(testName, Page.getArgs(), undefined, encodeURI(c.shortcuts)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-enableScreensharing parameter to false + // and checks that the Moderator can not see the Screen sharing button + test('Enable Screensharing', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'enableScreensharing'; + response = await test.enableScreensharing(testName, Page.getArgs(), undefined, c.enableScreensharing); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-enableVideo parameter to false + // and checks that the Moderator can not see the Webcam sharing button + test('Enable Webcam', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'enableVideo'; + response = await test.enableVideo(testName, Page.getArgsWithVideo(), undefined, c.enableVideo); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-autoShareWebcam parameter to true + // and checks that the Moderator sees the Webcam Settings Modal automatically at his connection to meeting + test('Auto Share Webcam', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'autoShareWebcam'; + response = await test.autoShareWebcam(testName, Page.getArgsWithVideo(), undefined, c.autoShareWebcam); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-multiUserPenOnly parameter to true + // and checks that at multi Users whiteboard other users can see only pencil as drawing tool + test('Multi Users Pen Only', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'multiUserPenOnly'; + response = await test.multiUserPenOnly(testName, Page.getArgs(), undefined, c.multiUserPenOnly); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-presenterTools parameter to an interval of parameters + // and checks that at multi Users whiteboard Presenter can see only the set tools from the interval + test('Presenter Tools', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'presenterTools'; + response = await test.presenterTools(testName, Page.getArgs(), undefined, encodeURI(c.presenterTools)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-multiUserTools parameter to an interval of parameters + // and checks that at multi Users whiteboard other users can see only the set tools from the interval + test('Multi Users Tools', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'multiUserTools'; + response = await test.multiUserTools(testName, Page.getArgs(), undefined, encodeURI(c.multiUserTools)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-customStyle parameter to an interval of styles + // and checks that the meeting displays what was called in the styles interval + test('Custom Styles', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'customStyle'; + response = await test.customStyle(testName, Page.getArgs(), undefined, encodeURIComponent(c.customStyle)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-customStyleUrl parameter to a styles URL + // and checks that the meeting displays what was called in the styles URL + test('Custom Styles URL', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'customStyleUrl'; + response = await test.customStyleUrl(testName, Page.getArgs(), undefined, encodeURI(c.customStyleUrl)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-autoSwapLayout parameter to true + // and checks that at any webcam share, the focus will be on the webcam, + // and the presentation gets minimized and the available shared webcam will replace the Presentation + test('Auto Swap Layout', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'autoSwapLayout'; + response = await test.autoSwapLayout(testName, Page.getArgs(), undefined, encodeURI(c.autoSwapLayout)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-hidePresentation parameter to true + // and checks that the Presentation is totally hidden, and its place will be displaying a message + test('Hide Presentation', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'hidePresentation'; + response = await test.hidePresentation(testName, Page.getArgs(), undefined, encodeURI(c.hidePresentation)); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-bannerText parameter to some text + // and checks that the meeting has a banner bar containing the same text + test('Banner Text', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'bannerText'; + response = await test.bannerText(testName, Page.getArgs(), undefined, c.bannerText); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-bannerColor parameter to some hex color value + // and checks that the meeting has a banner bar containing that color in rgb(r, g, b) + test('Banner Color', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'bannerColor'; + const colorToRGB = util.hexToRgb(c.color); + response = await test.bannerColor(testName, Page.getArgs(), undefined, `${c.bannerColor}&${encodeURI(c.bannerText)}`, colorToRGB); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-bbb_show_public_chat_on_login parameter to false + // and checks that the users don't see that box by default + test('Show Public Chat On Login', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'showPublicChatOnLogin'; + response = await test.showPublicChatOnLogin(testName, Page.getArgs(), undefined, `${c.showPublicChatOnLogin}`); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.closePage(test.page1); + } + expect(response).toBe(true); + }); + + // This test spec sets the userdata-bbb_force_restore_presentation_on_new_events parameter to true + // and checks that the viewers get the presentation restored forcefully when the Moderator zooms + // in/out the presentation or publishes a poll or adds an annotation + test('Force Restore Presentation On New Events', async () => { + const test = new CustomParameters(); + const page = new Page(); + let response; + try { + page.logger('before'); + const testName = 'forceRestorePresentationOnNewEvents'; + response = await test.forceRestorePresentationOnNewEvents(testName, Page.getArgs(), undefined, `${c.forceRestorePresentationOnNewEvents}`); + page.logger('after'); + } catch (e) { + page.logger(e); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = customParametersTest; diff --git a/bigbluebutton-html5/tests/puppeteer/customparameters.test.js b/bigbluebutton-html5/tests/puppeteer/customparameters.test.js index 292a8503852aaacc17794e5b03b0ab1cb3f48c14..3506eef2d2e76006203c4758c7d5256ed0b1ec4a 100644 --- a/bigbluebutton-html5/tests/puppeteer/customparameters.test.js +++ b/bigbluebutton-html5/tests/puppeteer/customparameters.test.js @@ -1,432 +1,3 @@ -const Page = require('./core/page'); -const CustomParameters = require('./customparameters/customparameters'); -const c = require('./customparameters/constants'); -const util = require('./customparameters/util'); +const customParametersTest = require('./customparameters.obj'); -describe('Custom parameters', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - // This test spec sets the userdata-autoJoin parameter to false - // and checks that the users don't get audio modal on login - test('Auto join', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'autoJoin'; - response = await test.autoJoin(testName, Page.getArgs(), undefined, c.autoJoin); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-listenOnlyMode parameter to false - // and checks that the users can't see or use listen Only mode - test('Listen Only Mode', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'listenOnlyMode'; - response = await test.listenOnlyMode(testName, Page.getArgsWithAudio(), undefined, c.listenOnlyMode); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-forceListenOnly parameter to false - // and checks that the Viewers can only use listen only mode - test('Force Listen Only', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'forceListenOnly'; - response = await test.forceListenOnly(testName, Page.getArgsWithAudio(), undefined, c.forceListenOnly); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page2); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-skipCheck parameter to true - // and checks that the users automatically skip audio check when clicking on Microphone - test('Skip audio check', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'skipCheck'; - response = await test.skipCheck(testName, Page.getArgsWithAudio(), undefined, c.skipCheck); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-clientTitle parameter to some value - // and checks that the meeting window name starts with that value - test('Client title', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'clientTitle'; - response = await test.clientTitle(testName, Page.getArgs(), undefined, c.clientTitle); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-askForFeedbackOnLogout parameter to true - // and checks that the users automatically get asked for feedback on logout page - test('Ask For Feedback On Logout', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'askForFeedbackOnLogout'; - response = await test.askForFeedbackOnLogout(testName, Page.getArgs(), undefined, c.askForFeedbackOnLogout); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-displayBrandingArea parameter to true and add a logo link - // and checks that the users see the logo displaying in the meeting - test('Display Branding Area', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'displayBrandingArea'; - const parameterWithLogo = `${c.displayBrandingArea}&${c.logo}`; - response = await test.displayBrandingArea(testName, Page.getArgs(), undefined, parameterWithLogo); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-shortcuts parameter to one or a list of shortcuts parameters - // and checks that the users can use those shortcuts - test('Shortcuts', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'shortcuts'; - response = await test.shortcuts(testName, Page.getArgs(), undefined, encodeURI(c.shortcuts)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-enableScreensharing parameter to false - // and checks that the Moderator can not see the Screen sharing button - test('Enable Screensharing', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'enableScreensharing'; - response = await test.enableScreensharing(testName, Page.getArgs(), undefined, c.enableScreensharing); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-enableVideo parameter to false - // and checks that the Moderator can not see the Webcam sharing button - test('Enable Webcam', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'enableVideo'; - response = await test.enableVideo(testName, Page.getArgsWithVideo(), undefined, c.enableVideo); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-autoShareWebcam parameter to true - // and checks that the Moderator sees the Webcam Settings Modal automatically at his connection to meeting - test('Auto Share Webcam', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'autoShareWebcam'; - response = await test.autoShareWebcam(testName, Page.getArgsWithVideo(), undefined, c.autoShareWebcam); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-multiUserPenOnly parameter to true - // and checks that at multi Users whiteboard other users can see only pencil as drawing tool - test('Multi Users Pen Only', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'multiUserPenOnly'; - response = await test.multiUserPenOnly(testName, Page.getArgs(), undefined, c.multiUserPenOnly); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-presenterTools parameter to an interval of parameters - // and checks that at multi Users whiteboard Presenter can see only the set tools from the interval - test('Presenter Tools', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'presenterTools'; - response = await test.presenterTools(testName, Page.getArgs(), undefined, encodeURI(c.presenterTools)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-multiUserTools parameter to an interval of parameters - // and checks that at multi Users whiteboard other users can see only the set tools from the interval - test('Multi Users Tools', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'multiUserTools'; - response = await test.multiUserTools(testName, Page.getArgs(), undefined, encodeURI(c.multiUserTools)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-customStyle parameter to an interval of styles - // and checks that the meeting displays what was called in the styles interval - test('Custom Styles', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'customStyle'; - response = await test.customStyle(testName, Page.getArgs(), undefined, encodeURIComponent(c.customStyle)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-customStyleUrl parameter to a styles URL - // and checks that the meeting displays what was called in the styles URL - test('Custom Styles URL', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'customStyleUrl'; - response = await test.customStyleUrl(testName, Page.getArgs(), undefined, encodeURI(c.customStyleUrl)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-autoSwapLayout parameter to true - // and checks that at any webcam share, the focus will be on the webcam, - // and the presentation gets minimized and the available shared webcam will replace the Presentation - test('Auto Swap Layout', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'autoSwapLayout'; - response = await test.autoSwapLayout(testName, Page.getArgs(), undefined, encodeURI(c.autoSwapLayout)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-hidePresentation parameter to true - // and checks that the Presentation is totally hidden, and its place will be displaying a message - test('Hide Presentation', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'hidePresentation'; - response = await test.hidePresentation(testName, Page.getArgs(), undefined, encodeURI(c.hidePresentation)); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-bannerText parameter to some text - // and checks that the meeting has a banner bar containing the same text - test('Banner Text', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'bannerText'; - response = await test.bannerText(testName, Page.getArgs(), undefined, c.bannerText); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-bannerColor parameter to some hex color value - // and checks that the meeting has a banner bar containing that color in rgb(r, g, b) - test('Banner Color', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'bannerColor'; - const colorToRGB = util.hexToRgb(c.color); - response = await test.bannerColor(testName, Page.getArgs(), undefined, `${c.bannerColor}&${encodeURI(c.bannerText)}`, colorToRGB); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-bbb_show_public_chat_on_login parameter to false - // and checks that the users don't see that box by default - test('Show Public Chat On Login', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'showPublicChatOnLogin'; - response = await test.showPublicChatOnLogin(testName, Page.getArgs(), undefined, `${c.showPublicChatOnLogin}`); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.closePage(test.page1); - } - expect(response).toBe(true); - }); - - // This test spec sets the userdata-bbb_force_restore_presentation_on_new_events parameter to true - // and checks that the viewers get the presentation restored forcefully when the Moderator zooms - // in/out the presentation or publishes a poll or adds an annotation - test('Force Restore Presentation On New Events', async () => { - const test = new CustomParameters(); - const page = new Page(); - let response; - try { - page.logger('before'); - const testName = 'forceRestorePresentationOnNewEvents'; - response = await test.forceRestorePresentationOnNewEvents(testName, Page.getArgs(), undefined, `${c.forceRestorePresentationOnNewEvents}`); - page.logger('after'); - } catch (e) { - page.logger(e); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); -}); +describe('Custom Parameters', customParametersTest); diff --git a/bigbluebutton-html5/tests/puppeteer/notifications.obj.js b/bigbluebutton-html5/tests/puppeteer/notifications.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..2a22036d36eee57a611c14fd78fa61109b89b0ea --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/notifications.obj.js @@ -0,0 +1,131 @@ +const Notifications = require('./notifications/notifications'); +const ShareScreen = require('./screenshare/screenshare'); +const Audio = require('./audio/audio'); +const Page = require('./core/page'); + +const notificationsTest = () => { + beforeEach(() => { + jest.setTimeout(50000); + }); + + test('Save settings notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'saveSettingsNotification'; + response = await test.saveSettingsNotification(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(test.page1, test.page2); + await test.page1.logger('Save Setting notification !'); + } + expect(response).toBe(true); + }); + + test('Public Chat notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'publicChatNotification'; + response = await test.publicChatNotification(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(test.page1, test.page2); + await test.page1.logger('Public Chat notification !'); + } + expect(response).toBe(true); + }); + + test('Private Chat notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'privateChatNotification'; + response = await test.privateChatNotification(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(test.page1, test.page2); + await test.page1.logger('Private Chat notification !'); + } + expect(response).toBe(true); + }); + + test('User join notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'userJoinNotification'; + response = await test.getUserJoinPopupResponse(testName); + } catch (e) { + console.log(e); + } finally { + await test.closePages(); + await test.page1.logger('User join notification !'); + } + expect(response).toBe(true); + }); + + test('Presentation upload notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'uploadPresentationNotification'; + response = await test.fileUploaderNotification(testName); + } catch (e) { + console.log(e); + } finally { + await test.closePage(test.page3); + await test.page3.logger('Presentation upload notification !'); + } + expect(response).toBe(true); + }); + + test('Poll results notification', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'pollResultsNotification'; + response = await test.publishPollResults(testName); + } catch (e) { + console.log(e); + } finally { + await test.closePage(test.page3); + await test.page3.logger('Poll results notification !'); + } + expect(response).toContain('Poll results were published to Public Chat and Whiteboard'); + }); + + test('Screenshare notification', async () => { + const page = new Notifications(); + let response; + try { + const testName = 'screenShareNotification'; + response = await page.screenshareToast(testName); + } catch (e) { + console.log(e); + } finally { + await page.closePage(page.page3); + await page.page3.logger('Screenshare notification !'); + } + expect(response).toBe('Screenshare has started'); + }); + + test('Audio notifications', async () => { + const test = new Notifications(); + let response; + try { + const testName = 'audioNotification'; + response = await test.audioNotification(testName); + } catch (e) { + console.log(e); + } finally { + await test.closePage(test.page3); + await test.page3.logger('Audio notification !'); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = notificationsTest; diff --git a/bigbluebutton-html5/tests/puppeteer/notifications.test.js b/bigbluebutton-html5/tests/puppeteer/notifications.test.js index 9d55f042c5e784d462460de07de4c453dddb378e..ccf4d54573236c85f177ea2c422e9d00f699afae 100644 --- a/bigbluebutton-html5/tests/puppeteer/notifications.test.js +++ b/bigbluebutton-html5/tests/puppeteer/notifications.test.js @@ -1,130 +1,3 @@ -const Notifications = require('./notifications/notifications'); -const ShareScreen = require('./screenshare/screenshare'); -const Audio = require('./audio/audio'); -const Page = require('./core/page'); +const notificationsTest = require('./notifications.obj'); -describe('Notifications', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Save settings notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'saveSettingsNotification'; - response = await test.saveSettingsNotification(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(test.page1, test.page2); - await test.page1.logger('Save Setting notification !'); - } - expect(response).toBe(true); - }); - - test('Public Chat notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'publicChatNotification'; - response = await test.publicChatNotification(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(test.page1, test.page2); - await test.page1.logger('Public Chat notification !'); - } - expect(response).toBe(true); - }); - - test('Private Chat notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'privateChatNotification'; - response = await test.privateChatNotification(testName); - } catch (e) { - console.log(e); - } finally { - await test.close(test.page1, test.page2); - await test.page1.logger('Private Chat notification !'); - } - expect(response).toBe(true); - }); - - test('User join notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'userJoinNotification'; - response = await test.getUserJoinPopupResponse(testName); - } catch (e) { - console.log(e); - } finally { - await test.closePages(); - await test.page1.logger('User join notification !'); - } - expect(response).toBe('User4 joined the session'); - }); - - test('Presentation upload notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'uploadPresentationNotification'; - response = await test.fileUploaderNotification(testName); - } catch (e) { - console.log(e); - } finally { - await test.closePage(test.page3); - await test.page3.logger('Presentation upload notification !'); - } - expect(response).toContain('Current presentation'); - }); - - test('Poll results notification', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'pollResultsNotification'; - response = await test.publishPollResults(testName); - } catch (e) { - console.log(e); - } finally { - await test.closePage(test.page3); - await test.page3.logger('Poll results notification !'); - } - expect(response).toContain('Poll results were published to Public Chat and Whiteboard'); - }); - - test('Screenshare notification', async () => { - const page = new Notifications(); - let response; - try { - const testName = 'screenShareNotification'; - response = await page.screenshareToast(testName); - } catch (e) { - console.log(e); - } finally { - await page.closePage(page.page3); - await page.page3.logger('Screenshare notification !'); - } - expect(response).toBe('Screenshare has started'); - }); - - test('Audio notifications', async () => { - const test = new Notifications(); - let response; - try { - const testName = 'audioNotification'; - response = await test.audioNotification(testName); - } catch (e) { - console.log(e); - } finally { - await test.closePage(test.page3); - await test.page3.logger('Audio notification !'); - } - expect(response).toBe(true); - }); -}); +describe('Notifications', notificationsTest); diff --git a/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js b/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js index 524c78fc1e840ce6891a8078ec0c7c548b3da419..b46adab978e4d5dcc5f7ac23d2cb7b248e665ff0 100644 --- a/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js +++ b/bigbluebutton-html5/tests/puppeteer/notifications/notifications.js @@ -5,6 +5,7 @@ const params = require('../params'); const util = require('./util'); const utilScreenShare = require('../screenshare/util'); // utils imported from screenshare folder const ne = require('./elements'); +const pe = require('../presentation/elements'); const we = require('../whiteboard/elements'); class Notifications extends MultiUsers { @@ -28,7 +29,7 @@ class Notifications extends MultiUsers { } async initUser4() { - await this.page4.init(Page.getArgs(), this.page3.meetingId, { ...params, fullName: 'User4' }); + await this.page4.init(Page.getArgs(), this.page3.meetingId, { ...params, fullName: 'User' }, undefined, undefined); } // Save Settings toast notification @@ -96,12 +97,19 @@ class Notifications extends MultiUsers { await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`); await this.userJoinNotification(this.page3); await this.page3.screenshot(`${testName}`, `03-page03-after-user-join-notification-activation-${testName}`); - await this.initUser4(undefined); + await this.initUser4(); await this.page4.closeAudioModal(); await this.page3.waitForSelector(ne.smallToastMsg); - const response = await util.getOtherToastValue(this.page3); - await this.page3.screenshot(`${testName}`, `04-page03-user-join-toast-${testName}`); - return response; + try { + await this.page3.page.waitForFunction( + 'document.querySelector("body").innerText.includes("User joined the session")', + ); + await this.page3.screenshot(`${testName}`, `04-page03-user-join-toast-${testName}`); + return true; + } catch (e) { + console.log(e); + return false; + } } // File upload notification @@ -112,17 +120,31 @@ class Notifications extends MultiUsers { await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`); await util.uploadFileMenu(this.page3); await this.page3.screenshot(`${testName}`, `03-page03-upload-file-menu-${testName}`); - await this.page3.waitForSelector(ne.fileUploadDropZone); - const inputUploadHandle = await this.page3.page.$('input[type=file]'); - await inputUploadHandle.uploadFile(path.join(__dirname, '../media/DifferentSizes.pdf')); - await this.page3.page.evaluate(util.clickTestElement, ne.modalConfirmButton); + await this.page3.waitForSelector(pe.fileUpload); + const fileUpload = await this.page3.page.$(pe.fileUpload); + await fileUpload.uploadFile(path.join(__dirname, '../media/DifferentSizes.pdf')); + await this.page3.page.waitForFunction( + 'document.querySelector("body").innerText.includes("To be uploaded ...")', + ); + await this.page3.page.waitForSelector(pe.upload); + await this.page3.page.click(pe.upload); + await this.page3.page.waitForFunction( + 'document.querySelector("body").innerText.includes("Converting file")', + ); await this.page3.screenshot(`${testName}`, `04-page03-file-uploaded-and-ready-${testName}`); await this.page3.waitForSelector(ne.smallToastMsg); await this.page3.waitForSelector(we.whiteboard); await this.page3.screenshot(`${testName}`, `05-page03-presentation-changed-${testName}`); - const resp = await util.getLastToastValue(this.page3); - await this.page3.screenshot(`${testName}`, `06-page03-presentation-change-toast-${testName}`); - return resp; + try { + await this.page3.page.waitForFunction( + 'document.querySelector("body").innerText.includes("Current presentation")', + ); + await this.page3.screenshot(`${testName}`, `06-page03-presentation-change-toast-${testName}`); + return true; + } catch (e) { + console.log(e); + return false; + } } // Publish Poll Results notification diff --git a/bigbluebutton-html5/tests/puppeteer/package-lock.json b/bigbluebutton-html5/tests/puppeteer/package-lock.json index 363ad501167a4383d5ea91f9e50de4c570bdd3c8..6024bd03e254d12fe53626632f1c6ed6368950df 100644 --- a/bigbluebutton-html5/tests/puppeteer/package-lock.json +++ b/bigbluebutton-html5/tests/puppeteer/package-lock.json @@ -588,15 +588,6 @@ "babel-template": "^6.24.1" } }, - "babel-jest": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", - "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", - "requires": { - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-jest": "^23.2.0" - } - }, "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", @@ -2229,6 +2220,17 @@ "jest-validate": "^23.6.0", "micromatch": "^2.3.11", "pretty-format": "^23.6.0" + }, + "dependencies": { + "babel-jest": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", + "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", + "requires": { + "babel-plugin-istanbul": "^4.1.6", + "babel-preset-jest": "^23.2.0" + } + } } }, "jest-diff": { diff --git a/bigbluebutton-html5/tests/puppeteer/package.json b/bigbluebutton-html5/tests/puppeteer/package.json index 762ccb51cac1b5cfcb78c40ce1a201797f7f8688..6496d2c0931599aecfb48bf2bc048aca066673cf 100644 --- a/bigbluebutton-html5/tests/puppeteer/package.json +++ b/bigbluebutton-html5/tests/puppeteer/package.json @@ -9,7 +9,7 @@ "axios": "^0.18.0", "dotenv": "^6.0.0", "jest": "^23.5.0", - "puppeteer": "2.0.0", + "puppeteer": "3.0.2", "moment": "^2.24.0", "sha1": "^1.1.1" } diff --git a/bigbluebutton-html5/tests/puppeteer/presentation.obj.js b/bigbluebutton-html5/tests/puppeteer/presentation.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..c63d6a106681057dfd837149bb7778c6517dc3c3 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/presentation.obj.js @@ -0,0 +1,41 @@ +const Page = require('./core/page'); +const Slide = require('./presentation/slide'); +const Upload = require('./presentation/upload'); + +const presentationTest = () => { + beforeEach(() => { + jest.setTimeout(50000); + }); + + test('Skip slide', async () => { + const test = new Slide(); + let response; + try { + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Upload presentation', async () => { + const test = new Upload(); + let response; + try { + const testName = 'uploadPresentation'; + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(testName); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = presentationTest; diff --git a/bigbluebutton-html5/tests/puppeteer/presentation.test.js b/bigbluebutton-html5/tests/puppeteer/presentation.test.js index 45d9bc751774707991e403d258c28e01c42165dc..063507a54acae73f684eaf79186afdcf0a9b82e3 100644 --- a/bigbluebutton-html5/tests/puppeteer/presentation.test.js +++ b/bigbluebutton-html5/tests/puppeteer/presentation.test.js @@ -1,39 +1,3 @@ -const Page = require('./core/page'); -const Slide = require('./presentation/slide'); -const Upload = require('./presentation/upload'); +const presentationTest = require('./presentation.obj'); -describe('Presentation', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Skip slide', async () => { - const test = new Slide(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Upload presentation', async () => { - const test = new Upload(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Presentation', presentationTest); diff --git a/bigbluebutton-html5/tests/puppeteer/presentation/elements.js b/bigbluebutton-html5/tests/puppeteer/presentation/elements.js index 48dc684750f70c31a027f3567b9edb137a613310..8491b989334f38f167c18bf417eda3a2c9aa72ab 100644 --- a/bigbluebutton-html5/tests/puppeteer/presentation/elements.js +++ b/bigbluebutton-html5/tests/puppeteer/presentation/elements.js @@ -2,7 +2,7 @@ exports.presentationToolbarWrapper = '#presentationToolbarWrapper'; exports.nextSlide = '[data-test="nextSlide"]'; exports.prevSlide = '[data-test="prevSlide"]'; exports.fileUpload = 'input[type="file"]'; -exports.upload = 'button[aria-label="Upload "]'; +exports.upload = 'button[aria-label="Upload"]'; exports.cancel = 'button[aria-label="Cancel]'; exports.uploadPresentation = '[data-test="uploadPresentation"]'; exports.skipSlide = '[data-test="skipSlide"]'; diff --git a/bigbluebutton-html5/tests/puppeteer/presentation/upload.js b/bigbluebutton-html5/tests/puppeteer/presentation/upload.js index b77237e6a8d0181932a1b296bd7ee966629c060c..8646508e6c3975eabc6e6a68588f72a3ecf76775 100644 --- a/bigbluebutton-html5/tests/puppeteer/presentation/upload.js +++ b/bigbluebutton-html5/tests/puppeteer/presentation/upload.js @@ -8,7 +8,7 @@ class Upload extends Page { super('presentation-upload'); } - async test() { + async test(testName) { await this.waitForSelector(we.whiteboard); await this.waitForSelector(e.skipSlide); @@ -17,34 +17,43 @@ class Upload extends Page { await this.click(ce.actions); await this.click(e.uploadPresentation); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `01-before-presentation-upload-[${testName}]`); + } await this.waitForSelector(e.fileUpload); const fileUpload = await this.page.$(e.fileUpload); await fileUpload.uploadFile(`${__dirname}/upload-test.png`); + await this.page.waitForFunction( + 'document.querySelector("body").innerText.includes("To be uploaded ...")', + ); + await this.page.waitForSelector(e.upload); - await this.click(e.upload); + await this.page.click(e.upload); console.log('\nWaiting for the new presentation to upload...'); - // await this.elementRemoved(e.start); - await this.page.waitFor(10000); + await this.page.waitForFunction( + 'document.querySelector("body").innerText.includes("Converting file")', + ); console.log('\nPresentation uploaded!'); - - await this.screenshot(true); + await this.page.waitForFunction( + 'document.querySelector("body").innerText.includes("Current presentation")', + ); + if (process.env.GENERATE_EVIDENCES === 'true') { + await this.screenshot(`${testName}`, `02-after-presentation-upload-[${testName}]`); + } const slides1 = await this.getTestElements(); console.log('\nSlides before presentation upload:'); - console.log(slides0.slideList); - console.log(slides0.svg); + console.log(slides0); console.log('\nSlides after presentation upload:'); - console.log(slides1.slideList); - console.log(slides1.svg); + console.log(slides1); - return slides0.svg !== slides1.svg; + return slides0 !== slides1; } async getTestElements() { - const slides = {}; - slides.svg = await this.page.evaluate(() => document.querySelector('svg g g g').outerHTML); - slides.slideList = await this.page.evaluate(skipSlide => document.querySelector(skipSlide).innerHTML, e.skipSlide); - return slides; + const svg = await this.page.evaluate(async () => await document.querySelector('svg g g g').outerHTML); + console.log(svg); + return svg; } } diff --git a/bigbluebutton-html5/tests/puppeteer/run.sh b/bigbluebutton-html5/tests/puppeteer/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..dd719d1ddccae87777c79753324cf69c078c4cbc --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/run.sh @@ -0,0 +1,88 @@ +#!/bin/bash -e + +usage() { + set +x + cat 1>&2 <<HERE +BBB Health Check + +OPTIONS: + -t <test name: whiteboard/webcam/virtualizedlist/user/sharednotes/screenshare/presentation/notifications/customparameters/chat/breakout/audio/all> + -h <hostname name of BigBlueButton server> + -s <Shared secret> + + -u Print usage +HERE + +} + +err() { + echo "----"; + echo ERROR: $@ + echo "----"; +} + +main() { + export DEBIAN_FRONTEND=noninteractive + + while builtin getopts "uh:s:t:" opt "${@}"; do + + case $opt in + t) + TEST=$OPTARG + ;; + + h) + HOST=$OPTARG + ;; + + s) + SECRET=$OPTARG + ;; + + u) + usage + exit 0 + ;; + + :) + err "Missing option argument for -$OPTARG" + exit 1 + ;; + + \?) + err "Invalid option: -$OPTARG" >&2 + usage + ;; + esac + done + + if [ -z "$TEST" ]; then + err "No test provided"; + usage + exit 1 + fi + + if [ -z "$HOST" ]; then + err "No host provided"; + usage + exit 1 + fi + + if [ -z "$SECRET" ]; then + err "No scret provided"; + usage + exit 1 + fi + + IS_AUDIO_TEST=false + + if [ "$TEST" = "audio" ]; then + IS_AUDIO_TEST=true; + fi; + +env $(cat tests/puppeteer/.env | xargs) jest $TEST.test.js --color --detectOpenHandles +} + + +main "$@" || exit 1 + diff --git a/bigbluebutton-html5/tests/puppeteer/screenshare.obj.js b/bigbluebutton-html5/tests/puppeteer/screenshare.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..26e6ae7a56920b45758b80233cc62a9683be50e2 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/screenshare.obj.js @@ -0,0 +1,24 @@ +const ShareScreen = require('./screenshare/screenshare'); +const Page = require('./core/page'); + +const screenShareTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Share screen', async () => { + const test = new ShareScreen(); + let response; + try { + await test.init(Page.getArgsWithVideo()); + await test.closeAudioModal(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = screenShareTest; diff --git a/bigbluebutton-html5/tests/puppeteer/screenshare.test.js b/bigbluebutton-html5/tests/puppeteer/screenshare.test.js index e1de8577ceb24afc2030ec61d7521ec9bf67bcc1..60f0eeca776a897badb9562c13f0a22721caef78 100644 --- a/bigbluebutton-html5/tests/puppeteer/screenshare.test.js +++ b/bigbluebutton-html5/tests/puppeteer/screenshare.test.js @@ -1,23 +1,3 @@ -const ShareScreen = require('./screenshare/screenshare'); -const Page = require('./core/page'); +const screenShareTest = require('./screenshare.obj'); -describe('Screen Share', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Share screen', async () => { - const test = new ShareScreen(); - let response; - try { - await test.init(Page.getArgsWithVideo()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Screen Share', screenShareTest); diff --git a/bigbluebutton-html5/tests/puppeteer/sharednotes.obj.js b/bigbluebutton-html5/tests/puppeteer/sharednotes.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..3db37120aa992608d514af6039341b1e26650e25 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/sharednotes.obj.js @@ -0,0 +1,24 @@ +const SharedNotes = require('./notes/sharednotes'); + +const sharedNotesTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Open Shared notes', async () => { + const test = new SharedNotes(); + let response; + try { + await test.init(); + await test.page1.closeAudioModal(); + await test.page2.closeAudioModal(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = sharedNotesTest; diff --git a/bigbluebutton-html5/tests/puppeteer/sharednotes.test.js b/bigbluebutton-html5/tests/puppeteer/sharednotes.test.js index b366f579c4e18732e7201325f09b92d82942f908..9dc6dd1c0db58033a7c2187dd31a8a3cb3fd2378 100644 --- a/bigbluebutton-html5/tests/puppeteer/sharednotes.test.js +++ b/bigbluebutton-html5/tests/puppeteer/sharednotes.test.js @@ -1,23 +1,3 @@ -const SharedNotes = require('./notes/sharednotes'); +const sharedNotesTest = require('./sharednotes.obj'); -describe('Shared notes', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Open Shared notes', async () => { - const test = new SharedNotes(); - let response; - try { - await test.init(); - await test.page1.closeAudioModal(); - await test.page2.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Shared Notes ', sharedNotesTest); diff --git a/bigbluebutton-html5/tests/puppeteer/user.obj.js b/bigbluebutton-html5/tests/puppeteer/user.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..de7d5e569f18d56f9986b7d8257b1ca2274c3f82 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/user.obj.js @@ -0,0 +1,41 @@ +const Page = require('./core/page'); +const Status = require('./user/status'); +const MultiUsers = require('./user/multiusers'); + +const userTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Change status', async () => { + const test = new Status(); + let response; + try { + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Multi user presence check', async () => { + const test = new MultiUsers(); + let response; + try { + await test.init(); + await test.page1.closeAudioModal(); + await test.page2.closeAudioModal(); + response = await test.test(); + } catch (err) { + console.log(err); + } finally { + await test.close(test.page1, test.page2); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = userTest; diff --git a/bigbluebutton-html5/tests/puppeteer/user.test.js b/bigbluebutton-html5/tests/puppeteer/user.test.js index 91025cc63e3a2a8422c405a6474b77fcf1e43c99..fea6e8d04ab7aff6bc2a09629b318232263a4b06 100644 --- a/bigbluebutton-html5/tests/puppeteer/user.test.js +++ b/bigbluebutton-html5/tests/puppeteer/user.test.js @@ -1,40 +1,3 @@ -const Page = require('./core/page'); -const Status = require('./user/status'); -const MultiUsers = require('./user/multiusers'); +const userTest = require('./user.obj'); -describe('User', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Change status', async () => { - const test = new Status(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Multi user presence check', async () => { - const test = new MultiUsers(); - let response; - try { - await test.init(); - await test.page1.closeAudioModal(); - await test.page2.closeAudioModal(); - response = await test.test(); - } catch (err) { - console.log(err); - } finally { - await test.close(test.page1, test.page2); - } - expect(response).toBe(true); - }); -}); +describe('User', userTest); diff --git a/bigbluebutton-html5/tests/puppeteer/virtualizedlist.obj.js b/bigbluebutton-html5/tests/puppeteer/virtualizedlist.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..9c47a0ca60903a4c2b454c75f20c549373ca6a76 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/virtualizedlist.obj.js @@ -0,0 +1,18 @@ +const VirtualizedList = require('./virtualizedlist/virtualize'); + +const virtualizedListTest = () => { + test('Virtualized Users List', async () => { + const test = new VirtualizedList(); + let response; + try { + await test.init(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }, parseInt(process.env.TEST_DURATION_TIME)); +}; +module.exports = exports = virtualizedListTest; diff --git a/bigbluebutton-html5/tests/puppeteer/virtualizedlist.test.js b/bigbluebutton-html5/tests/puppeteer/virtualizedlist.test.js index 8a1a599e9c32a1c0965935fc763073e113912e1b..5135a8c979a5a8312a76318eefe71d0073dc8cfb 100644 --- a/bigbluebutton-html5/tests/puppeteer/virtualizedlist.test.js +++ b/bigbluebutton-html5/tests/puppeteer/virtualizedlist.test.js @@ -1,17 +1,3 @@ -const VirtualizedList = require('./virtualizedlist/virtualize'); +const virtualizedListTest = require('./virtualizedlist.obj'); -describe('Virtualized List', () => { - test('Virtualized List Audio test', async () => { - const test = new VirtualizedList(); - let response; - try { - await test.init(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }, parseInt(process.env.TEST_DURATION_TIME)); -}); +describe('Virtualized List', virtualizedListTest); diff --git a/bigbluebutton-html5/tests/puppeteer/webcam.obj.js b/bigbluebutton-html5/tests/puppeteer/webcam.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..3212fe35bbe1707b71dbf1243432f131372a11c8 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/webcam.obj.js @@ -0,0 +1,38 @@ +const Share = require('./webcam/share'); +const Check = require('./webcam/check'); +const Page = require('./core/page'); + +const webcamTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Shares webcam', async () => { + const test = new Share(); + let response; + try { + await test.init(Page.getArgsWithVideo()); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); + + test('Checks content of webcam', async () => { + const test = new Check(); + let response; + try { + await test.init(Page.getArgsWithVideo()); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = webcamTest; diff --git a/bigbluebutton-html5/tests/puppeteer/webcam.test.js b/bigbluebutton-html5/tests/puppeteer/webcam.test.js index de311de7310e19a6d66ebc4aec7515ce6518518c..39e1f657dde205dad17537bf683a4adf90c49ebb 100644 --- a/bigbluebutton-html5/tests/puppeteer/webcam.test.js +++ b/bigbluebutton-html5/tests/puppeteer/webcam.test.js @@ -1,37 +1,3 @@ -const Share = require('./webcam/share'); -const Check = require('./webcam/check'); -const Page = require('./core/page'); +const webcamTest = require('./webcam.obj'); -describe('Webcam', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Shares webcam', async () => { - const test = new Share(); - let response; - try { - await test.init(Page.getArgsWithVideo()); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); - - test('Checks content of webcam', async () => { - const test = new Check(); - let response; - try { - await test.init(Page.getArgsWithVideo()); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Webcam', webcamTest); diff --git a/bigbluebutton-html5/tests/puppeteer/whiteboard.obj.js b/bigbluebutton-html5/tests/puppeteer/whiteboard.obj.js new file mode 100644 index 0000000000000000000000000000000000000000..ec47850f137f894c45d03e66f6ff39fc235a4ed6 --- /dev/null +++ b/bigbluebutton-html5/tests/puppeteer/whiteboard.obj.js @@ -0,0 +1,24 @@ +const Page = require('./core/page'); +const Draw = require('./whiteboard/draw'); + +const whiteboardTest = () => { + beforeEach(() => { + jest.setTimeout(30000); + }); + + test('Draw rectangle', async () => { + const test = new Draw(); + let response; + try { + await test.init(Page.getArgs()); + await test.closeAudioModal(); + response = await test.test(); + } catch (e) { + console.log(e); + } finally { + await test.close(); + } + expect(response).toBe(true); + }); +}; +module.exports = exports = whiteboardTest; diff --git a/bigbluebutton-html5/tests/puppeteer/whiteboard.test.js b/bigbluebutton-html5/tests/puppeteer/whiteboard.test.js index 7dedf21410e72ca0eceae144a9b8d48468359ddc..46e252f5d1390ef73e8fb08efad5048d5a7b7a1c 100644 --- a/bigbluebutton-html5/tests/puppeteer/whiteboard.test.js +++ b/bigbluebutton-html5/tests/puppeteer/whiteboard.test.js @@ -1,23 +1,3 @@ -const Page = require('./core/page'); -const Draw = require('./whiteboard/draw'); +const whiteboardTest = require('./whiteboard.obj'); -describe('Whiteboard', () => { - beforeEach(() => { - jest.setTimeout(30000); - }); - - test('Draw rectangle', async () => { - const test = new Draw(); - let response; - try { - await test.init(Page.getArgs()); - await test.closeAudioModal(); - response = await test.test(); - } catch (e) { - console.log(e); - } finally { - await test.close(); - } - expect(response).toBe(true); - }); -}); +describe('Whiteboard', whiteboardTest); diff --git a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties index ae142853ab75eaa6736d7664437c62d31d6c077b..376d32b5a83bb18365645ec4fae61cf152ab5f5c 100755 --- a/bigbluebutton-web/grails-app/conf/bigbluebutton.properties +++ b/bigbluebutton-web/grails-app/conf/bigbluebutton.properties @@ -172,19 +172,10 @@ defaultMaxUsers=0 # Current default is 0 (meeting doesn't end). defaultMeetingDuration=0 -# Number of minutes elapse of no activity before -# ending the meeting. Default zero (0) to disable -# check. -maxInactivityTimeoutMinutes=0 - # Number of minutes to logout client if user # isn't responsive clientLogoutTimerInMinutes=0 -# Send warning to moderators to warn that -# meeting would be ended due to inactivity -warnMinutesBeforeMax=5 - # End meeting if no user joined within # a period of time after meeting created. meetingExpireIfNoUserJoinedInMinutes=5 diff --git a/bigbluebutton-web/grails-app/conf/spring/resources.xml b/bigbluebutton-web/grails-app/conf/spring/resources.xml index ff695f99cd1ebeb348df2b1418102d7ade3c9b73..4fe99c78bc8d1314f25e566f5ce8e1dcff221332 100755 --- a/bigbluebutton-web/grails-app/conf/spring/resources.xml +++ b/bigbluebutton-web/grails-app/conf/spring/resources.xml @@ -136,8 +136,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <property name="defaultAvatarURL" value="${defaultAvatarURL}"/> <property name="defaultConfigURL" value="${defaultConfigURL}"/> <property name="defaultGuestPolicy" value="${defaultGuestPolicy}"/> - <property name="maxInactivityTimeoutMinutes" value="${maxInactivityTimeoutMinutes}"/> - <property name="warnMinutesBeforeMax" value="${warnMinutesBeforeMax}"/> <property name="meetingExpireIfNoUserJoinedInMinutes" value="${meetingExpireIfNoUserJoinedInMinutes}"/> <property name="meetingExpireWhenLastUserLeftInMinutes" value="${meetingExpireWhenLastUserLeftInMinutes}"/> <property name="userInactivityInspectTimerInMinutes" value="${userInactivityInspectTimerInMinutes}"/> diff --git a/labs/vertx-akka/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala b/labs/vertx-akka/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala index 92a47f39cfc1c1d1e36f4770effad555316c336d..cd7b18454cfe328daeb889f244a1c4ae8efacf8a 100755 --- a/labs/vertx-akka/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala +++ b/labs/vertx-akka/src/main/scala/org/bigbluebutton/client/meeting/AllowedMessageNames.scala @@ -22,7 +22,6 @@ object AllowedMessageNames { UserBroadcastCamStopMsg.NAME, LogoutAndEndMeetingCmdMsg.NAME, GetRecordingStatusReqMsg.NAME, - MeetingActivityResponseCmdMsg.NAME, SetRecordingStatusCmdMsg.NAME, EjectUserFromMeetingCmdMsg.NAME, IsMeetingMutedReqMsg.NAME, @@ -86,14 +85,6 @@ object AllowedMessageNames { UpdateCaptionOwnerPubMsg.NAME, EditCaptionHistoryPubMsg.NAME, - // Shared Notes Messages - GetSharedNotesPubMsg.NAME, - CreateSharedNoteReqMsg.NAME, - DestroySharedNoteReqMsg.NAME, - UpdateSharedNoteReqMsg.NAME, - SyncSharedNotePubMsg.NAME, - ClearSharedNotePubMsg.NAME, - // Layout Messages GetCurrentLayoutReqMsg.NAME, BroadcastLayoutMsg.NAME, diff --git a/record-and-playback/core/lib/recordandplayback/events_archiver.rb b/record-and-playback/core/lib/recordandplayback/events_archiver.rb index cf2437704600dc22c3895db4c22301059cf83b06..fc7269c743cf6e785666406e279e78480bc73894 100755 --- a/record-and-playback/core/lib/recordandplayback/events_archiver.rb +++ b/record-and-playback/core/lib/recordandplayback/events_archiver.rb @@ -228,8 +228,13 @@ module BigBlueButton # Apply a cleanup that removes certain ranges of special # control characters from user-provided text + # Based on https://www.w3.org/TR/xml/#charsets + # Remove all Unicode characters not valid in XML, and also remove + # discouraged characters (includes control characters) in the U+0000-U+FFFF + # range (the higher values are just undefined characters, and are unlikely + # to cause issues). def strip_control_chars(str) - str.tr("\x00-\x08\x0B\x0C\x0E-\x1F\x7F", '') + str.scrub.tr("\x00-\x08\x0B\x0C\x0E-\x1F\x7F\uFDD0-\uFDEF\uFFFE\uFFFF", '') end def store_events(meeting_id, events_file, break_timestamp) diff --git a/record-and-playback/core/scripts/rap-starter.rb b/record-and-playback/core/scripts/rap-starter.rb index 932c206eefb74b76bbc158275d03878b7a379e9f..2bd2686bf7594cbe3cc7cdf0a4dc1e31b80825f4 100755 --- a/record-and-playback/core/scripts/rap-starter.rb +++ b/record-and-playback/core/scripts/rap-starter.rb @@ -92,7 +92,7 @@ begin # Check for missed "ended" .done files ended_done_files = Dir.glob("#{ended_status_dir}/*.done") ended_done_files.each do |ended_done_file| - keep_meeting_events(recording_id, ended_done_file) + keep_meeting_events(recording_dir, ended_done_file) end # Check for missed "recorded" .done files diff --git a/record-and-playback/presentation/playback/presentation/2.0/lib/popcorn.chattimeline.js b/record-and-playback/presentation/playback/presentation/2.0/lib/popcorn.chattimeline.js index 0838bd926819470d24fa000e5be8e1ea4e0cbdcf..aeb9b586dc3c5f852b6680510d2bcc06bbecc94b 100755 --- a/record-and-playback/presentation/playback/presentation/2.0/lib/popcorn.chattimeline.js +++ b/record-and-playback/presentation/playback/presentation/2.0/lib/popcorn.chattimeline.js @@ -58,7 +58,7 @@ i++; - contentDiv.innerHTML = "<strong>" + options.name + ":</strong>" + options.message; + contentDiv.innerHTML = "<strong>" + options.name + ":</strong>" + nl2br(options.message); //If chat message contains a link, we add to it a target attribute //So when the user clicks on it, it opens in a new tab diff --git a/record-and-playback/presentation/playback/presentation/2.0/playback.js b/record-and-playback/presentation/playback/presentation/2.0/playback.js index e182b01ce6a944539cc401bd82e776d09326dad9..6336734307c7a15aca6c0de6515fbce4494dee7c 100755 --- a/record-and-playback/presentation/playback/presentation/2.0/playback.js +++ b/record-and-playback/presentation/playback/presentation/2.0/playback.js @@ -130,6 +130,43 @@ function replaceTimeOnURL(secs) { window.history.replaceState({}, "", newUrl); }; +/* + * From: https://locutus.io/php/strings/nl2br/ + */ +function nl2br (str, isXhtml) { + // discuss at: https://locutus.io/php/nl2br/ + // original by: Kevin van Zonneveld (https://kvz.io) + // improved by: Philip Peterson + // improved by: Onno Marsman (https://twitter.com/onnomarsman) + // improved by: Atli Þór + // improved by: Brett Zamir (https://brett-zamir.me) + // improved by: Maximusya + // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) + // bugfixed by: Kevin van Zonneveld (https://kvz.io) + // bugfixed by: Reynier de la Rosa (https://scriptinside.blogspot.com.es/) + // input by: Brett Zamir (https://brett-zamir.me) + // example 1: nl2br('Kevin\nvan\nZonneveld') + // returns 1: 'Kevin<br />\nvan<br />\nZonneveld' + // example 2: nl2br("\nOne\nTwo\n\nThree\n", false) + // returns 2: '<br>\nOne<br>\nTwo<br>\n<br>\nThree<br>\n' + // example 3: nl2br("\nOne\nTwo\n\nThree\n", true) + // returns 3: '<br />\nOne<br />\nTwo<br />\n<br />\nThree<br />\n' + // example 4: nl2br(null) + // returns 4: '' + + // Some latest browsers when str is null return and unexpected null value + if (typeof str === 'undefined' || str === null) { + return '' + } + + // Adjust comment to avoid issue on locutus.io display + var breakTag = (isXhtml || typeof isXhtml === 'undefined') ? '<br ' + '/>' : '<br>' + + return (str + '') + .replace(/(\r\n|\n\r|\r|\n)/g, breakTag + '$1') +} + + /* * Sets the title attribute in a thumbnail. */