<commit_before><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Shumway viewer</title>

    <!-- <base href="resource://shumway/web/viewer.html" /> -->
    <script src="../lib/DataView.js/DataView.js"></script>
    <script src="../lib/Kanvas/kanvas.js"></script>

    <!-- Load SWF Dependencies -->
    <script src="../swf/util.js"></script>
    <script src="../swf/swf.js"></script>
    <script src="../swf/types.js"></script>
    <script src="../swf/structs.js"></script>
    <script src="../swf/tags.js"></script>
    <script src="../swf/inflate.js"></script>
    <script src="../swf/stream.js"></script>
    <script src="../swf/templates.js"></script>
    <script src="../swf/generator.js"></script>
    <script src="../swf/parser.js"></script>
    <script src="../swf/bitmap.js"></script>
    <script src="../swf/button.js"></script>
    <script src="../swf/font.js"></script>
    <script src="../swf/image.js"></script>
    <script src="../swf/label.js"></script>
    <script src="../swf/shape.js"></script>
    <script src="../swf/text.js"></script>


    <script src="../swf/prototypes.js"></script>

    <!-- Load AVM1 Dependencies -->
    <script src="../avm1/classes.js"></script>
    <script src="../avm1/globals.js"></script>
    <script src="../avm1/stream.js"></script>
    <script src="../avm1/interpreter.js"></script>
    <script src="../swf/embed.js"></script>
    <script src="../swf/renderer.js"></script>

    <script src="../flash/util.js"></script>
    <script src="../flash/events/EventPhase.js"></script>
    <script src="../flash/events/Event.js"></script>
    <script src="../flash/events/ProgressEvent.js"></script>
    <script src="../flash/events/EventDispatcher.js"></script>
    <script src="../flash/display/DisplayObject.js"></script>
    <script src="../flash/display/InteractiveObject.js"></script>
    <script src="../flash/display/DisplayObjectContainer.js"></script>
    <script src="../flash/display/Graphics.js"></script>
    <script src="../flash/display/Sprite.js"></script>
    <script src="../flash/display/Loader.js"></script>
    <script src="../flash/display/LoaderInfo.js"></script>
    <script src="../flash/display/MovieClip.js"></script>
    <script src="../flash/display/Stage.js"></script>
    <script src="../flash/ui/Keyboard.js"></script>
    <script src="../flash/ui/Mouse.js"></script>

    <script>
      // Extenstion communication object... as it used in pdf.js
      var FirefoxCom = (function FirefoxComClosure() {
        return {
          /**
            * Creates an event that the extension is listening for and will
            * synchronously respond to.
            * NOTE: It is reccomended to use request() instead since one day we may not
            * be able to synchronously reply.
            * @param {String} action The action to trigger.
            * @param {String} data Optional data to send.
            * @return {*} The response.
            */
          requestSync: function(action, data) {
            var request = document.createTextNode('');
            request.setUserData('action', action, null);
            request.setUserData('data', data, null);
            request.setUserData('sync', true, null);
            document.documentElement.appendChild(request);

            var sender = document.createEvent('Events');
            sender.initEvent('shumway.message', true, false);
            request.dispatchEvent(sender);
            var response = request.getUserData('response');
            document.documentElement.removeChild(request);
            return response;
          },
          /**
            * Creates an event that the extension is listening for and will
            * asynchronously respond by calling the callback.
            * @param {String} action The action to trigger.
            * @param {String} data Optional data to send.
            * @param {Function} callback Optional response callback that will be called
            * with one data argument.
            */
          request: function(action, data, callback) {
            var request = document.createTextNode('');
            request.setUserData('action', action, null);
            request.setUserData('data', data, null);
            request.setUserData('sync', false, null);
            if (callback) {
              request.setUserData('callback', callback, null);

              document.addEventListener('shumway.response', function listener(event) {
                var node = event.target,
                    callback = node.getUserData('callback'),
                    response = node.getUserData('response');

                document.documentElement.removeChild(node);

                document.removeEventListener('shumway.response', listener, false);
                return callback(response);
              }, false);
            }
            document.documentElement.appendChild(request);

            var sender = document.createEvent('HTMLEvents');
            sender.initEvent('shumway.message', true, false);
            return request.dispatchEvent(sender);
          }
        };
      })();

      function fallback() {
        FirefoxCom.requestSync('fallback', null)
      }

      function runViewer() {
        var flashParams = JSON.parse(FirefoxCom.requestSync('getPluginParams', null));
        var movieUrl = flashParams.url;
        var movieArgs = flashParams.arguments;
        var isOverlay = flashParams.isOverlay;
        console.log("url=" + movieUrl + ";params=" + uneval(movieArgs));
        FirefoxCom.requestSync('loadFile', movieUrl);
        if (isOverlay) {
          var fallbackDiv = document.getElementById('fallback');
          fallbackDiv.className = 'enabled';
          fallbackDiv.addEventListener('click', function(e) {
            fallback();
            e.preventDefault();
          });
        }
      }

      addEventListener("message", function handlerMessage(e) {
        var args = e.data;
        switch (args.callback) {
          case "loadFile":
            parseSwf(args.url, args.array);
            break;
        }
      }, true);

      function parseSwf(url, file) {
        console.log("Parsing " + url + "...");
        SWF.embed(file, document.getElementById("viewer"));
      }
        
    </script>
    <style>
      #viewer {
        position:fixed;left:0;top:0;bottom:0;right:0;
        background-color:magenta;
      }

      #fallback {
        display: none;
      }
      #fallback.enabled {
        display: block;
        position:fixed; right: 10px; bottom: 10px; width: 70px; height: 14px;
        color: white;
        background-color: #400040;
        font: bold 10px sans-serif;
        text-align: center;
        text-decoration: none;
        border-radius: 5px;
        box-shadow: 0px 0px 3px 3px #888;
      }
      #fallback .icon {
        display: inline-block;<commit_msg>Sync extension to inspector js inclusions.<commit_after><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Shumway viewer</title>

    <!-- <base href="resource://shumway/web/viewer.html" /> -->
    <script src="../lib/DataView.js/DataView.js"></script>
    <script src="../lib/Kanvas/kanvas.js"></script>

    <!-- Load SWF Dependencies -->
    <script src="../swf/util.js"></script>
    <script src="../swf/swf.js"></script>
    <script src="../swf/types.js"></script>
    <script src="../swf/structs.js"></script>
    <script src="../swf/tags.js"></script>
    <script src="../swf/inflate.js"></script>
    <script src="../swf/stream.js"></script>
    <script src="../swf/templates.js"></script>
    <script src="../swf/generator.js"></script>
    <script src="../swf/parser.js"></script>
    <script src="../swf/bitmap.js"></script>
    <script src="../swf/button.js"></script>
    <script src="../swf/font.js"></script>
    <script src="../swf/image.js"></script>
    <script src="../swf/label.js"></script>
    <script src="../swf/shape.js"></script>
    <script src="../swf/text.js"></script>

    <!-- not used in inspector -->
    <script src="../swf/prototypes.js"></script>

    <!-- Load AVM1 Dependencies -->
    <script src="../avm1/classes.js"></script>
    <script src="../avm1/globals.js"></script>
    <script src="../avm1/stream.js"></script>
    <script src="../avm1/interpreter.js"></script>
    <script src="../swf/embed.js"></script>
    <script src="../swf/renderer.js"></script>

    <!-- Load AVM2 Dependencies -->
    <script src="../avm2/util.js"></script>
    <script src="../avm2/options.js"></script>
    <script src="../avm2/metrics.js"></script>
    <script src="../avm2/constants.js"></script>
    <script src="../avm2/errors.js"></script>
    <script src="../avm2/opcodes.js"></script>
    <script src="../avm2/parser.js"></script>
    <script src="../avm2/analyze.js"></script>
    <script src="../avm2/compiler/lljs/src/estransform.js"></script>
    <script src="../avm2/compiler/lljs/src/escodegen.js"></script>
    <script src="../avm2/compiler/inferrer.js"></script>
    <script src="../avm2/compiler/compiler.js"></script>
    <script src="../avm2/domain.js"></script>
    <script src="../avm2/runtime.js"></script>
    <script src="../avm2/native.js"></script>
    <script src="../avm2/disassembler.js"></script>
    <script src="../avm2/interpreter.js"></script>
    <script src="../avm2/vm.js"></script>
    
    <!-- Load Flash Dependencies -->
    <script src="../flash/util.js"></script>
    
    <!-- not used in inspector -->
    <script src="../flash/events/EventPhase.js"></script>

    <script src="../flash/util.js"></script>
    <script src="../flash/events/Event.js"></script>
    <script src="../flash/events/KeyboardEvent.js"></script>
    <script src="../flash/events/MouseEvent.js"></script>
    <script src="../flash/events/TimerEvent.js"></script>
    <script src="../flash/events/EventDispatcher.js"></script>
    <script src="../flash/net/NetConnection.js"></script>
    <script src="../flash/net/NetStream.js"></script>
    <script src="../flash/display/DisplayObject.js"></script>
    <script src="../flash/display/InteractiveObject.js"></script>
    <script src="../flash/display/DisplayObjectContainer.js"></script>
    <script src="../flash/display/Sprite.js"></script>
    <script src="../flash/display/MovieClip.js"></script>
    <script src="../flash/display/Loader.js"></script>
    <script src="../flash/display/LoaderInfo.js"></script>
    <script src="../flash/display/Stage.js"></script>
    <script src="../flash/display/BitmapData.js"></script>
    <script src="../flash/display/Graphics.js"></script>
    <script src="../flash/display/Shape.js"></script>
    <script src="../flash/display/SimpleButton.js"></script>
    <script src="../flash/geom/Point.js"></script>
    <script src="../flash/geom/Rectangle.js"></script>
    <script src="../flash/geom/Matrix.js"></script>
    <script src="../flash/geom/ColorTransform.js"></script>
    <script src="../flash/geom/Transform.js"></script>
    <!--
    <script src="../flash/media/SoundTransform.js"></script>
    -->
    <script src="../flash/media/Video.js"></script>
    <!--
    <script src="../flash/text/Font.js"></script>
    -->
    <script src="../flash/text/StaticText.js"></script>
    <script src="../flash/text/TextField.js"></script>
    <script src="../flash/ui/Keyboard.js"></script>
    <!--
    <script src="../flash/ui/Mouse.js"></script>
    -->
    <script src="../flash/utils/Timer.js"></script>
    <script src="../flash/stubs.js"></script>

    <script>
      // Extenstion communication object... as it used in pdf.js
      var FirefoxCom = (function FirefoxComClosure() {
        return {
          /**
            * Creates an event that the extension is listening for and will
            * synchronously respond to.
            * NOTE: It is reccomended to use request() instead since one day we may not
            * be able to synchronously reply.
            * @param {String} action The action to trigger.
            * @param {String} data Optional data to send.
            * @return {*} The response.
            */
          requestSync: function(action, data) {
            var request = document.createTextNode('');
            request.setUserData('action', action, null);
            request.setUserData('data', data, null);
            request.setUserData('sync', true, null);
            document.documentElement.appendChild(request);

            var sender = document.createEvent('Events');
            sender.initEvent('shumway.message', true, false);
            request.dispatchEvent(sender);
            var response = request.getUserData('response');
            document.documentElement.removeChild(request);
            return response;
          },
          /**
            * Creates an event that the extension is listening for and will
            * asynchronously respond by calling the callback.
            * @param {String} action The action to trigger.
            * @param {String} data Optional data to send.
            * @param {Function} callback Optional response callback that will be called
            * with one data argument.
            */
          request: function(action, data, callback) {
            var request = document.createTextNode('');
            request.setUserData('action', action, null);
            request.setUserData('data', data, null);
            request.setUserData('sync', false, null);
            if (callback) {
              request.setUserData('callback', callback, null);

              document.addEventListener('shumway.response', function listener(event) {
                var node = event.target,
                    callback = node.getUserData('callback'),
                    response = node.getUserData('response');

                document.documentElement.removeChild(node);

                document.removeEventListener('shumway.response', listener, false);
                return callback(response);
              }, false);
            }
            document.documentElement.appendChild(request);

            var sender = document.createEvent('HTMLEvents');
            sender.initEvent('shumway.message', true, false);
            return request.dispatchEvent(sender);
          }
        };
      })();

      function fallback() {
        FirefoxCom.requestSync('fallback', null)
      }

      function runViewer() {
        var flashParams = JSON.parse(FirefoxCom.requestSync('getPluginParams', null));
        var movieUrl = flashParams.url;
        var movieArgs = flashParams.arguments;
        var isOverlay = flashParams.isOverlay;
        console.log("url=" + movieUrl + ";params=" + uneval(movieArgs));
        FirefoxCom.requestSync('loadFile', movieUrl);
        if (isOverlay) {
          var fallbackDiv = document.getElementById('fallback');
          fallbackDiv.className = 'enabled';
          fallbackDiv.addEventListener('click', function(e) {
            fallback();
            e.preventDefault();
          });
        }
      }

      addEventListener("message", function handlerMessage(e) {
        var args = e.data;
        switch (args.callback) {
          case "loadFile":
            parseSwf(args.url, args.array);
            break;
        }
      }, true);

      function parseSwf(url, file) {
        console.log("Parsing " + url + "...");
        SWF.embed(file, document.getElementById("viewer"));
      }
        
    </script>
    <style>
      #viewer {
        position:fixed;left:0;top:0;bottom:0;right:0;
        /* background-color:magenta; */
      }

      #fallback {
        display: none;
      }
      #fallback.enabled {
        display: block;
        position:fixed; right: 10px; bottom: 10px; width: 70px; height: 14px;
        color: white;
        background-color: #400040;
        font: bold 10px sans-serif;
        text-align: center;
        text-decoration: none;
        border-radius: 5px;
        box-shadow: 0px 0px 3px 3px #888;
      }
      #fallback .icon {
        display: inline-block;
{'fraction_non_alphanumeric': 0.17438557490428555, 'fraction_numerical': 0.0056193651969865385, 'mean_word_length': 2.2950152594099693, 'pattern_counts': {'":': 2, '<': 282, '<?xml version=': 0, '>': 282, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4926795', 'n_tokens_mistral': 4640, 'n_tokens_neox': 4532, 'n_words': 876}