Bläddra i källkod

Adds an option for a hint message shown only to guests.

j8
damencho 8 år sedan
förälder
incheckning
63aa60f2d6
2 ändrade filer med 16 tillägg och 2 borttagningar
  1. 14
    2
      close.js
  2. 2
    0
      interface_config.js

+ 14
- 2
close.js Visa fil

@@ -1,4 +1,4 @@
1
-/* global interfaceConfig */
1
+/* global interfaceConfig, getConfigParamsFromUrl */
2 2
 //list of tips
3 3
 var hints = [
4 4
     "You can pin participants by clicking on their thumbnails.",// jshint ignore:line
@@ -32,7 +32,7 @@ function insertTextMsg(id, msg){
32 32
     var el = document.getElementById(id);
33 33
 
34 34
     if (el)
35
-        el.innerText = msg;
35
+        el.innerHTML = msg;
36 36
 }
37 37
 
38 38
 /**
@@ -42,6 +42,18 @@ function onLoad() {
42 42
     //Works only for close2.html because close.html doesn't have this element.
43 43
     insertTextMsg('thanksMessage',
44 44
         'Thank you for using ' + interfaceConfig.APP_NAME);
45
+
46
+    // If there is a setting show a special message only for the guests
47
+    if (interfaceConfig.CLOSE_PAGE_GUEST_HINT) {
48
+        let params = getConfigParamsFromUrl('search');
49
+        if ( params.guest ) {
50
+            var element = document.getElementById('hintQuestion');
51
+            element.classList.add('hide');
52
+            insertTextMsg('hintMessage', interfaceConfig.CLOSE_PAGE_GUEST_HINT);
53
+            return;
54
+        }
55
+    }
56
+
45 57
     insertTextMsg('hintMessage', getHint());
46 58
 }
47 59
 

+ 2
- 0
interface_config.js Visa fil

@@ -53,6 +53,8 @@ var interfaceConfig = { // eslint-disable-line no-unused-vars
53 53
      * Whether to only show the filmstrip (and hide the toolbar).
54 54
      */
55 55
     filmStripOnly: false,
56
+    //A html text to be shown to guests on the close page, false disables it
57
+    CLOSE_PAGE_GUEST_HINT: false,
56 58
     RANDOM_AVATAR_URL_PREFIX: false,
57 59
     RANDOM_AVATAR_URL_SUFFIX: false,
58 60
     FILM_STRIP_MAX_HEIGHT: 120,

Laddar…
Avbryt
Spara