Skip to content

Instantly share code, notes, and snippets.

@BigaDev
Last active August 29, 2015 14:02
Show Gist options
  • Save BigaDev/4326684e1058b05b35a9 to your computer and use it in GitHub Desktop.
Save BigaDev/4326684e1058b05b35a9 to your computer and use it in GitHub Desktop.
Biga on Rails
class Hello
def say_hello
puts "Hello"
end
end
<script type="text/javascript">
$(document).ready(function(){
alert("F")
$('#ember1052').focus();
$('#bt-0').focus();
});
function createButtonBar() {
var html = '';
for (var i = 0; i < 4; i++) {
html += "<input type='button' onclick='document.getElementsById('ember1052').focus()' id='bt-" + i + "' value='bt'></input>"
};
return html;
}
function focusUI(){
$('#ember1052').focus();
}
function insertHTML(id, html) {
var el = document.getElementsByClassName(id);
if(!el) {
alert('Element with id ' + id + ' not found.');
}
el[0].innerHTML = html + el[0].innerHTML;
}
function run() {
var html = createButtonBar();
insertHTML('floatingheader', html);
alert("hi")
}
window.onpageshow = run;
</script>
class test
end
@AmiraNasrullah
Copy link

<!doctype html>

<title>Ghost Admin</title>

<base href="/" />
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
<meta name="pinterest" content="nopin" />

<meta http-equiv="cleartype" content="on" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Ghost" />

<link rel="shortcut icon" href="{{asset "favicon.ico"}}" />
<link rel="apple-touch-icon-precomposed" href="{{asset "img/touch-icon-iphone.png" ghost="true"}}" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{asset "img/touch-icon-ipad.png" ghost="true"}}" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{asset "img/small.png" ghost="true"}}" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{asset "img/medium.png" ghost="true"}}" />

<meta name="application-name" content="Ghost" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-square70x70logo" content="{{asset "img/small.png" ghost="true"}}" />
<meta name="msapplication-square150x150logo" content="{{asset "img/medium.png" ghost="true"}}" />
<meta name="msapplication-square310x310logo" content="{{asset "img/large.png" ghost="true"}}" />

{{#each configuration}}
    <meta name="env-{{this.key}}" content="{{this.value}}" />
{{/each}}

{{#unless skip_google_fonts}}
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700" />
{{/unless}}

<link rel="stylesheet" href="{{asset "vendor.css" ghost="true" minifyInProduction="true"}}" />
<link rel="stylesheet" href="{{asset "ghost.css" ghost="true" minifyInProduction="true"}}" />
<script src="{{asset "vendor.js" ghost="true" minifyInProduction="true"}}"></script>
<script src="{{asset "ghost.js" ghost="true" minifyInProduction="true"}}"></script>

  <script type="text/javascript">
    $(document).ready(function(){
        window.focusUI =function(){
            $('.ember-text-area').focus();
        }

         function createButtonBar() {
                var html = '';
                for (var i = 0; i < 4; i++) {
                    html += "<input type='button' onclick='focusUI()' id='bt-" + i + "' value='bt'></input>" 
                }; 
                return html;
            }



            function insertHTML(id, html) {
                var el = document.getElementsByClassName(id);

                if(!el) {
                    alert('Element with id ' + id + ' not found.');
                }

                el[0].innerHTML = html + el[0].innerHTML;
            }

            function run() {
                var html = createButtonBar();
                insertHTML('floatingheader', html);
                alert("hi")
            }
            window.onload = run;
        $(document).on('click', '.post-edit', function(){
            function createButtonBar() {
                var html = '';
                for (var i = 0; i < 4; i++) {
                    html += "<input type='button' onclick='document.getElementsById('ember1052').focus()' id='bt-" + i + "' value='bt'></input>" 
                }; 
                return html;
            }

            function focusUI(){
                $('#ember1052').focus();
            }

            function insertHTML(id, html) {
                var el = document.getElementsByClassName(id);

                if(!el) {
                    alert('Element with id ' + id + ' not found.');
                }

                el[0].innerHTML = html + el[0].innerHTML;
            }

            function run() {
                var html = createButtonBar();
                insertHTML('floatingheader', html);
                alert("hi")
            }
            run();
        });
    });
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment