<commit_before><?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Kaltura Wave"
               height="310"
               author="papyromancer"
               author_email="<EMAIL>">
    <Require feature="wave" />
    <Require feature="locked-domain" />
    <Require feature="dynamic-height" />
    <Require feature="flash" />
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
      <div id="kaltura-wave">
        <div id="kcontribute" style="text-align:center""></div>
        <div id="kplayer" style="text-align:center"></div>
        <div id="kedit" style="text-align:center""></div>
      </div>
      
      <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
      <script type="text/javascript" src="http://wave-api.appspot.com/public/wave.js"></script>

      <script type="text/javascript">
        // Init!
        function initialize() {
          // Make wave state aware
            if (wave && wave.isInWaveContainer()) {
/              wave.setStateCallback(receiveState, this);
/              wave.setParticipantCallback(receiveWaveParticipants, this);
/              wave.setModeCallback(receiveMode, this);
            };
        };

        function receiveState(state) {
          wave.log("Got state: " + gadgets.json.stringify(state));
          gadgets.window.adjustHeight();
        };

        function receiveWaveParticipants(participants) {
          var str = '';
          var name = "unknown";
          if (wave.getViewer()) {
            name = wave.getViewer().getDisplayName();
          };
          str += 'I am ' + name + '<br/>';
          str += 'Participants:' + '<br/>';
          for (var i in participants) {
            str += '&nbsp;&nbsp;&nbsp;' + participants[i].getDisplayName() + '<br/>';
          };
          gadgets.window.adjustHeight();
        };

        function receiveMode(mode) {
          var modeStr = "UNKNOWN";
          switch (mode) {
            case wave.Mode.PLAYBACK: modeStr = "PLAYBACK"; break;
            case wave.Mode.EDIT: modeStr = "EDIT"; break;
            case wave.Mode.VIEW: modeStr = "VIEW"; break;
          }
          var disableButtons = !(mode == wave.Mode.EDIT);
        };

        function updateState() {
          var state = wave.getState();
          var participants = wave.getParticipants();
          var entry_id = state.get('entry_id');
          if !entry_id {
            //video has not been chosen!
          }
          if ((typeof entry_id == 'string') && (entry_id) {
            wavePlay(entry_id);
          } else {
            //video has not been chosen
          }
          state.submitDelta({'entry_id' : entry_id });
        }

        // Function to select a video to insert into the player
        function waveContribute() {
          
          // Set Variables for kcontribute
          var kvars = {
                      //entry_id: entry_id "knrwbq7z4o"
                      };
          
          // kflashvars should be constructed from the kvars object
          var kflashvars = "entry_id="+entry_id // knrwbq7z4o"
          
          var kparams = {
                        allowscriptaccess: "always",
                        allownetworking: "all",
                        allowfullscreen: "true",
                        wmode: "opaque",
                        width: "400",
                        height: "290"
                        };

          gadgets.flash.embedFlash("http://www.kaltura.com/kcw/ui_conf_id/1000741 "+kflashvars, "kplayer", "9.0.0", kparams );
        };

        // Function to populate kplayer with current video
        function wavePlay(entry_id) {
        
          // Set Variables for kplayer
          var kvars = {
                      entry_id: entry_id //"knrwbq7z4o"
                      };
          
          // kflashvars should be constructed from the kvars object
          var kflashvars = "entry_id="+entry_id // knrwbq7z4o"
          
          var kparams = {
                        allowscriptaccess: "always",
                        allownetworking: "all",
                        allowfullscreen: "true",
                        wmode: "opaque",
                        width: "400",
                        height: "290"
                        };
          // embed kplayer
          gadgets.flash.embedFlash("http://www.kaltura.com/kwidget/wid/_39061/ui_conf_id/1008311?"+kflashvars, "kplayer", "9.0.0", kparams );
        };
        
        // Call init function
        gadgets.util.registerOnLoadHandler(initialize);

wavePlay("knrwbq7z4o")

        </script>
    ]]>
  </Content>
</Module><commit_msg>Partner ID and Subpartner ID are being placed in the state<commit_after><?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Kaltura Wave"
               height="310"
               author="papyromancer"
               author_email="<EMAIL>">
    <Require feature="wave" />
    <Require feature="locked-domain" />
    <Require feature="dynamic-height" />
    <Require feature="flash" />
  </ModulePrefs>
  <Content type="html">
    <![CDATA[

      <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
      <script type="text/javascript" src="http://wave-api.appspot.com/public/wave.js"></script>

      <script type="text/javascript">
        // Init!
        function initialize() {
          // Make wave state aware
            if (wave && wave.isInWaveContainer()) {
              wave.setStateCallback(receiveState, this);
            //  wave.setParticipantCallback(receiveWaveParticipants, this);
            //  wave.setModeCallback(receiveMode, this);
            }
        }

        function receiveState(state) {
          document.getElementById("debugDiv").innerHTML += "State: " + state + "<br />";
        }

        // Set Kaltura Login Credentials
        function chooseKalturaPartner() {
          var state = wave.getState();
          var kalturaPartnerId = parseInt(document.getElementById('kalturaPartnerId').value);
          var kalturaSubPartnerId = parseInt(document.getElementById('kalturaSubPartnerId').value);
          state.submitDelta({'kalturaPartnerId' : kalturaPartnerId, 'kalturaSubPartnerId' : kalturaSubPartnerId});
        }

        // Function to select a video to insert into the player
        function waveContribute() {
          
          // Set Variables for kcontribute
          var kvars = {
                      //entry_id: entry_id "knrwbq7z4o"
                      };
          
          // kflashvars should be constructed from the kvars object
          var kflashvars = "entry_id="+entry_id // knrwbq7z4o"
          
          var kparams = {
                        allowscriptaccess: "always",
                        allownetworking: "all",
                        allowfullscreen: "true",
                        wmode: "opaque",
                        width: "400",
                        height: "290"
                        };

          gadgets.flash.embedFlash("http://www.kaltura.com/kcw/ui_conf_id/1000741 "+kflashvars, "kplayer", "9.0.0", kparams );
        };

        // Function to populate kplayer with current video
        function wavePlay(entry_id) {
        
          // Set Variables for kplayer
          var kvars = {
                      entry_id: entry_id //"knrwbq7z4o"
                      };
          
          // kflashvars should be constructed from the kvars object
          var kflashvars = "entry_id="+entry_id // knrwbq7z4o"
          
          var kparams = {
                        allowscriptaccess: "always",
                        allownetworking: "all",
                        allowfullscreen: "true",
                        wmode: "opaque",
                        width: "400",
                        height: "290"
                        };
          // embed kplayer
          gadgets.flash.embedFlash("http://www.kaltura.com/kwidget/wid/_39061/ui_conf_id/1008311?"+kflashvars, "kplayer", "9.0.0", kparams );
        };
        
        // Call init function
        gadgets.util.registerOnLoadHandler(initialize);

//wavePlay("knrwbq7z4o")

      </script>
      
      <div id="kaltura-wave">
        <div id="ksetup" style="text-align:center">
          <table align="center">
            <tr>
              <td>
                <p>Kaltura Partner ID</p>
              </td>
              <td>
                <input id="kalturaPartnerId" size="15" value="0">
              </td>
            </tr>
            <tr>
              <td>
                <p>Kaltura Subpartner ID</p>
              </td>
              <td>
                <input id="kalturaSubPartnerId" size="15" value="0">
              </td>
            </tr>
            <tr>
              <td colspan="2" align="right">
                <button id="login_button" type="button" onclick="chooseKalturaPartner()">
                  Login
                </button>
              </td>
            </tr>
          </table>
        </div>
        <div id="kcontribute" style="text-align:center"></div>
        <div id="kplayer" style="text-align:center"></div>
        <div id="kedit" style="text-align:center"></div>
      </div>
      <div id="debugDiv" style="width:100%; height:200px; overflow:scroll"></div>
    ]]>
  </Content>
</Module>
{'fraction_non_alphanumeric': 0.1280206207711309, 'fraction_numerical': 0.013424981205026313, 'mean_word_length': 1.5373297002724795, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 2, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '440894', 'n_tokens_mistral': 2708, 'n_tokens_neox': 2567, 'n_words': 513}