Browse Source

Added title to frame

Manuel Gall 3 years ago
parent
commit
7616584225
3 changed files with 4 additions and 1 deletions
  1. 1 1
      frames
  2. 1 0
      frames.xml
  3. 2 0
      template/js/ui.js

+ 1 - 1
frames

@@ -53,7 +53,7 @@ class InitFrame < Riddl::Implementation
     #for handler
     File.write(File.join('data',@r.last,'dataelements.json'),JSON.dump(JSON.parse('{"data":[]}')))
 
-    File.write(File.join('data',@r.last,'info.json'),JSON.dump(JSON.parse('{"x_amount":' + @p[2].value + ', "y_amount":' + @p[3].value + ', "lang":"' + @p[4].value  + '", "langs":["' + @p[4].value +  '"]}')))
+    File.write(File.join('data',@r.last,'info.json'),JSON.dump(JSON.parse('{"x_amount":' + @p[2].value + ', "y_amount":' + @p[3].value + ', "lang":"' + @p[4].value  + '", "langs":["' + @p[4].value +  '"], "document_name": "' + @p[5].value + '"}')))
 
     File.write(File.join('data',@r.last,'callback'),@h['CPEE_CALLBACK'])
     File.write(File.join('data',@r.last,'cpeeinstance.url'),@h['CPEE_INSTANCE_URL'])

+ 1 - 0
frames.xml

@@ -23,6 +23,7 @@
     <parameter name="x_amount" type="string"/>
     <parameter name="y_amount" type="string"/>
     <parameter name="lang" type="string"/>
+    <parameter name="document_name" type="string"/>
   </message>
   <message name="sframe">
     <parameter name="type" fixed="set"/>

+ 2 - 0
template/js/ui.js

@@ -180,6 +180,8 @@ function showDocument() {
     url: 'info.json',
     success: function(ret) {
       makeGrid(ret.x_amount, ret.y_amount);
+      //set name
+      document.title = ret.document_name;
       $.ajax({
         type: "GET",
         url: 'frames.json',