Commit 5080843b authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Rename refreshPage function to loadInlineExample.

More descriptive.

Also added options parameter to default implementation of
loadInlineExample, just for completeness, as it's passed there
although not used.
parent e65fb05e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ Ext.define('Docs.view.examples.InlinePreview', {
            // 1 ms works in Chrome, Firefox wants something bigger. Works in IE too.
            iframe.onload = function() {
                Ext.Function.defer(function() {
                    iframe.contentWindow.refreshPage(code, options);
                    iframe.contentWindow.loadInlineExample(code, options);
                }, 100);
            };
            iframe.src = "eg-iframe.html";
+65 −3
Original line number Diff line number Diff line
@@ -4,13 +4,75 @@
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Sencha Examples</title>

    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
    <script type="text/javascript" src="touch/sencha-touch-all.js"></script>
    <link rel="stylesheet" type="text/css" href="touch/resources/css/sencha-touch.css">

    <style id="iframe-css" type="text/css"></style>
    <style type="text/css" media="screen">
        html {
            overflow: hidden
        }

        .home {
            text-align: center;
        }

        .home img {
            width: 64%;
        }

        .home h1 {
            font-weight: bold;
            font-size: 1.2em;
        }

        .home p {
            color: #666;
            font-size: 0.8em;
            line-height: 1.5em;
            margin: 10px 20px 12px 20px;
        }

        .home h2 {
            color: #999;
            font-size: 0.7em;
        }

		.twitterView .x-dataview-item {
			padding: 10px;
			min-height: 50px;
		}

		.twitterView .x-dataview-item img {
			float: left;
			display: block;
			margin-top: 36px;
		}

		.twitterView .x-dataview-item h2 {
			font-weight: bold;
			color: #333;
			margin: 0px 0px 10px 60px;
		}

		.twitterView .x-dataview-item p {
			color: #666;
			margin-left: 60px;
			font-size: 0.8em;
		}
    </style>

    <script type="text/javascript">
        var refreshPage = function(code) {
        function loadInlineExample(code, options) {
            try {
                document.body.innerHTML = '';
                if (!options.raw) {
                    code = "Ext.setup({onReady: function(){" + code + "}});";
                }
                if (options.tablet) {
                    // Scale example down to 70% size. Default font-size is 114%
                    Ext.get('iframe-css').update("body {font-size: 79.8% !important}");
                }
                eval(code);
            } catch (e) {
                document.body.innerHTML = e;
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@
    </style>

    <script type="text/javascript">
        var refreshPage = function(code, options) {
        function loadInlineExample(code, options) {
            try {
                document.body.innerHTML = '';
                if (!options.raw) {