Insert a dash application using a html iframe
356402
def plotly_app(context, name=None, slug=None, da=None, ratio=0.1, use_frameborder=False, initial_arguments=None):
    ''

    fbs = '1' if use_frameborder else '0'

    dstyle = """
    position: relative;
    padding-bottom: %s%%;
    height: 0;
    overflow:hidden;
    """ % (ratio*100)

    istyle = """
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    """

    cache_id = store_initial_arguments(context['request'], initial_arguments)

    da, app = _locate_daapp(name, slug, da, cache_id=cache_id)

    return locals()
434808
function inject_stylesheet_shim () {
      if (options.include_css) {
        var style_tag = '<link rel="stylesheet" type="text/css" href="' + options.include_css + '">';
        if (options.css_insert_marker && html.indexOf(options.css_insert_marker) !== -1) {
          html = html.replace(options.css_insert_marker, style_tag);
        }
        else {
          var shims = ["</head>", "<body>", "</html>"];
          inject(style_tag, shims);
        }
      }
    }
457666
def html(args = {})
      id     = SecureRandom.uuid
      width  = args[:width]  || "50"
      config = args[:config] || @config.json
      type   = @config.type

      "<div id=\"canvas-holder\" style=\"width:#{width}%\">
        <canvas id=\"#{id}\" />
      </div>
      <script>
        var config = #{config}
        window.onload = function() {
          var ctx = document.getElementById(\"#{id}\").getContext(\"2d\");
          new Chart(ctx, config);
        };
      </script>" 
    end
910396
function DashDocsetTheme(renderer, basePath) {
                _super.call(this, renderer, basePath);
                renderer.on(output.Renderer.EVENT_BEGIN, this.onRendererBegin, this, 1024);
                this.dashIndexPlugin = new DashIndexPlugin(renderer);
                this.dashAssetsPlugin = new DashAssetsPlugin(renderer);
                this.infoPlistPlugin = new InfoPlistPlugin(renderer);
            }
1073611
def capture_dash_in_url_name(self, node):
        
        for keyword in node.keywords:
            if keyword.arg == 'name' and '-' in keyword.value.s:
                return DJ04(
                    lineno=node.lineno,
                    col=node.col_offset,
                )
325319
def dyndoc_insert(src):
    """"""
    # manipulating docstrings this way is tricky due to indentation
    # the JSON needs leading whitespace to be interpreted correctly
    import json
    import re

    def mkblock(d, flag=0):
        # response, pretty formatted
        v = json.dumps(d, indent=2)
        if flag == 1:
            # strip the '[' and ']' in case of a list holding items
            # that stand on their own (example: tick records from a stream)
            nw = re.findall('.*?\[(.*)\]', v, flags=re.S)
            v = nw[0]
        # add leading whitespace for each line and start with a newline
        return "\n{}".format("".join(["{0:>16}{1}\n".format("", L)
                             for L in v.split('\n')]))

    def dec(obj):
        allSlots = re.findall("\{(_v3.*?)\}", obj.__doc__)
        docsub = {}
        sub = {}
        for k in allSlots:
            p = re.findall("^(_v3.*)_(.*)", k)
            p = list(*p)
            sub.update({p[1]: p[0]})

        for v in sub.values():
            for k in sub.keys():
                docsub["{}_url".format(v)] = "{}".format(src[v]["url"])
                if "resp" == k:
                    docsub.update({"{}_resp".format(v):
                                   mkblock(src[v]["response"])})
                if "body" == k:
                    docsub.update({"{}_body".format(v):
                                   mkblock(src[v]["body"])})

                if "params" == k:
                    docsub.update({"{}_params".format(v):
                                   mkblock(src[v]["params"])})
                if "ciresp" == k:
                    docsub.update({"{}_ciresp".format(v):
                                   mkblock(src[v]["response"], 1)})

        obj.__doc__ = obj.__doc__.format(**docsub)

        return obj

    return dec
844663
function(baseUrl, url) {
  if (!resolveCache) {
    var iframe = document.createElement('iframe');
    document.documentElement.appendChild(iframe);
    var doc = iframe.contentWindow.document;
    var base = doc.createElement('base');
    doc.documentElement.appendChild(base);
    var a = doc.createElement('a');
    doc.documentElement.appendChild(a);
    iframe.parentNode.removeChild(iframe);
    resolveCache = {
      iframe: iframe,
      base: base,
      a: a
    };
  }
  resolveCache.base.href = baseUrl;
  resolveCache.a.href = url;
  return resolveCache.a.href;
}
720676
def display_ipaper(options = {})
      id = options.delete(:id) || to_param
      view_mode = options.delete(:view_mode) || 'list'

      <<-END
        <iframe class="scribd_iframe_embed" src="http://www.scribd.com/embeds/#{ipaper_id}/content?start_page=1&view_mode=#{view_mode}&access_key=#{ipaper_access_key}" data-auto-height="true" scrolling="no" id="scribd_#{id}" width="100%" frameborder="0"></iframe><script type="text/javascript">(function() { var scribd = document.createElement("script"); scribd.type = "text/javascript"; scribd.async = true; scribd.src = "http://www.scribd.com/javascripts/embed_code/inject.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(scribd, s); })();</script>
      END
    end
782515
function (cssText) {
            cssText = cssText.replace(/\burl\s*\(\s*["']?([^"'\r\n,]+|[^'\r\n,]+|[^"\r\n,]+)["']?\s*\)/gi, ariaUtilsFunction.bind(function (match, urlpart) {
                var prefixedUrl = ariaCoreAppEnvironment.applicationSettings.imgUrlMapping(urlpart, this.tplClasspath);
                return this._parseImgUrl(prefixedUrl);
            }, this));

            return cssText;
        }
1051806
function () {

            var iframe, document = Aria.$window.document;

            iframe = document.createElement('iframe');

            iframe.setAttribute('id', this.IFRAME_ID);
            iframe.style.display = 'none';

            document.body.appendChild(iframe);

            this._iframe = iframe;
            this.polledIframeHashString = this._currentHashString;

            this._addIframeHistoryEntry(this._currentHashString);
        }
848199
def append_application_menu      
      html = ''
      Roroacms.append_menu.each do |f|
        html += (render :partial => 'roroacms/admin/partials/append_sidebar_menu', :locals => { :menu_block => f })
      end
      html.html_safe
    end
896091
function showInterfaceIdl(intf, html) {
    html.push("<div class='show-Idl'><h3>IDL</h3><pre>")
    html.push("interface {")

    intf.methods.forEach(function(method){
        showInterfaceIdlMethod(method, html)
    })

    if (intf.attributes.length > 0) html.push("<table>")
    intf.attributes.forEach(function(attribute){
        showInterfaceIdlAttribute(attribute, html)
    })
    if (intf.attributes.length > 0) html.push("</table>")

    html.push("};")
    html.push("</pre></div>")
}
1274133
public static HtmlTree IFRAME(String src, String name, String title) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
        return htmltree;
    }
726062
function _getLi(srcUrl, iframeSrc) {
  var innerUl = [];

  if (srcUrl) {
    innerUl.push(util.format(sourceTemplate, srcUrl));
  }

  if (iframeSrc) {
    innerUl.push(util.format(newTabTemplate, iframeSrc));
  }

  return innerUl.join('');
}
882305
function() {
        if (this.useIFrame === true) {
            if (!this.frame.childNodes.length) {
                var eventPane = document.createElement("div"),
                    style = eventPane.style;
                style.position = "absolute";
                style.width = "100%";
                style.height = "100%";
                style.zIndex = 1;
                style.backgroundImage = "url(" + this.blankImageUrl + ")";
                this.frame.appendChild(eventPane);
            }

            var id = this.id + '_iFrame', iframe;
            if (parseFloat(navigator.appVersion.split("MSIE")[1]) < 9) {
                // Older IE versions do not set the name attribute of an iFrame 
                // properly via DOM manipulation, so we need to do it on our own with
                // this hack.
                iframe = document.createElement('<iframe name="'+id+'">');

                // IFrames in older IE versions are not transparent, if you set
                // the backgroundColor transparent. This is a workaround to get 
                // transparent iframes.
                iframe.style.backgroundColor = '#FFFFFF';
                iframe.style.filter          = 'chroma(color=#FFFFFF)';
            }
            else {
                iframe = document.createElement('iframe');
                iframe.style.backgroundColor = 'transparent';

                // iframe.name needs to be an unique id, otherwise it 
                // could happen that other iframes are overwritten.
                iframe.name = id;
            }

            // some special properties to avoid scaling the images and scrollbars 
            // in the iframe
            iframe.scrolling      = 'no';
            iframe.marginWidth    = '0px';
            iframe.marginHeight   = '0px';
            iframe.frameBorder    = '0';

            iframe.style.position = "absolute";
            iframe.style.width    = "100%";
            iframe.style.height   = "100%";

            if (this.layer.opacity < 1) {
                OpenLayers.Util.modifyDOMElement(iframe, null, null, null,
                    null, null, null, this.layer.opacity);
            }
            this.frame.appendChild(iframe);
            this.imgDiv = iframe;
            return iframe;
        } else {
            return OpenLayers.Tile.Image.prototype.getImage.apply(this, arguments);
        }
    }
153361
function(tab) {
        var that = this;
        if(typeof tab === 'string') {
            that.url = tab;
        } else if($.isPlainObject(tab)) {
            $.extend(that, tab);
        }
        if(!that.id) {
            that.id = $.zui.uuid();
        }
        if(!that.type) {
            if(that.iframe) {
                that.type = 'iframe';
                that.url = that.url || that.iframe;
            } else if(that.ajax) {
                that.type = 'ajax';
                that.url = that.url || ($.isPlainObject(that.ajax) ? that.ajax.url : that.ajax);
            } else if(that.url) {
                that.type = tab.ajax ? 'ajax' : 'iframe';
            } else {
                that.type = 'custom';
            }
        }
        that.createTime = new Date().getTime();
        that.openTime = 0;
        that.onCreate && that.onCreate.call(that);
    }
589211
function inject_script_shim () {
      if (options.include_js) {
        var script_tag = '<script type="text/javascript" src="' + options.include_js + '"></script>';
        if (options.js_insert_marker && html.indexOf(options.js_insert_marker) !== -1) {
          html = html.replace(options.js_insert_marker, script_tag);
        }
        else {
          var shims = ["</body>", "</html>", "</head>"];
          inject(script_tag, shims);
        }
      }
    }