Advertisement
Guest User

Untitled

a guest
Apr 8th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <Module>
  3. <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4.  * use this file except in compliance with the License. You may obtain a copy of
  5.  * the License at
  6.  *
  7.  * http://www.apache.org/licenses/LICENSE-2.0
  8.  * 
  9.  * Unless required by applicable law or agreed to in writing, software
  10.  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11.  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12.  * License for the specific language governing permissions and limitations under
  13.  * the License
  14. -->
  15.     <ModulePrefs title="Hangout Starter">
  16.         <Require feature="rpc" />
  17.         <Require feature="views" />
  18.     </ModulePrefs>
  19.     <Content type="html"><![CDATA[    
  20.  
  21. <html>
  22. <style type="text/css">
  23. <!--
  24. .button {
  25.   border-radius: 3px;
  26.   -moz-border-radius: 3px;
  27.   background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ddd));
  28.   background: -moz-linear-gradient(top, #fff, #ddd);  
  29.   border: 1px solid #bbb;
  30. }
  31.  
  32. .button:active {
  33.     background: -webkit-gradient(linear, left top, left bottom, from(#aaa), to(#333));
  34.     background: -moz-linear-gradient(bottom, #ddd, #aaa); }
  35.  
  36. -->
  37. </style>
  38. <body>
  39.  
  40. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  41. <script src="//plus.google.com/hangouts/_/api/v1/hangout.js"></script>
  42.  
  43. <h3>Bienvenue sur eGG-one school</h3>
  44.  
  45. <p>
  46. <input class="button" type="button" value="Show url!" id="showUrl"
  47.     style="visibility:hidden;"
  48.     onClick="showUrl()"/>
  49. </p>
  50.  
  51. <div id="urlDiv"></div>
  52.  
  53. <script>
  54. var appData = gadgets.views.getParams()['appData'];
  55.   var participant_id = 138;
  56.   var created_at     = "efa152b69a63ace053cf806a4dd22586f19cfc22";
  57.  
  58. function showUrl() {
  59.   var url = gapi.hangout.getHangoutUrl();
  60.  
  61.   $.ajax({
  62.     url: "http://school.egg-one.com/ws/hangout/new",
  63.     data: {participant_id: participant_id, created_at: created_at},
  64.     beforeSend: function() {
  65.           alert(participant_id+' '+created_at);
  66.     },
  67.     complete: function() {
  68.       alert('complete!');
  69.     },
  70.     success: function() {
  71.       alert('sucess');
  72.     },
  73.     error: function(xhr, status, error) {
  74.       alert(xhr.responseText+' '+status+' '+error);
  75.     }
  76.   });
  77. }
  78.  
  79. function init() {
  80.   // When API is ready...                                                        
  81.   gapi.hangout.onApiReady.add(
  82.       function(eventObj) {
  83.         if (eventObj.isApiReady) {
  84.           document.getElementById('showUrl')
  85.             .style.visibility = 'visible';
  86.         }
  87.       });
  88. }
  89.  
  90. // Wait for gadget to load.                                                      
  91. gadgets.util.registerOnLoadHandler(init);
  92. </script>
  93. </body>
  94. ]]>
  95. </Content>
  96. </Module>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement