Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta charset="UTF-8">
        <title>views</title>
        <script id="sap-ui-bootstrap" 
                src="https://openui5.netweaver.ondemand.com/resources/sap-ui-core.js"
                data-sap-ui-theme="sap_bluecrystal"
                data-sap-ui-libs="sap.m"
                data-sap-ui-xx-bindingSyntax="complex">
        </script>
        <!-- XML-based view definition -->
        <script id="view1" type="sapui5/xmlview">
            <mvc:View
                controllerName="local.controller"
                xmlns:mvc="sap.ui.core.mvc"
                xmlns="sap.m">
                <!-- Add your XML-based controls here -->
                <Button
                    icon="sap-icon://example"
                    text="Invalidate view"
                    press="clicked" />
            </mvc:View> 
        </script>
        <script>
            // Controller definition
            sap.ui.controller("local.controller", {
                
                onInit: function(oEvent) {
                    alert("onInit()");
                },
                onBeforeRendering: function(oEvent) {
                    alert("onBeforeRendering()");
                },
                clicked: function(oEvent) {
                    this.getView().invalidate();
                }
            });
            
            // Instantiate the View, assign a model and display
            var oView = sap.ui.xmlview({
                viewContent: jQuery("#view1").html()
            });
            
            oView.setModel(new sap.ui.model.json.JSONModel({
                name: "value"
            }));
            
            oView.placeAt("content");
        </script>
    </head>
    <body class="sapUiBody" role="application" id="content">
    </body>
</html>
 
if (location.pathname === '/welcome' || location.pathname === '/welcome/') {
  location = '/welcome/edit?html,live';
}
if (window.location.pathname.indexOf('/edit') !== -1) $('a.open').click(function (event) {
  event.preventDefault();
  window.top.$('a[href$="' + this.hash + '"]').mousedown().click();
});
var presses = 0;
var spin = [
  "Woahohaohaohaahoahaohaohaohaohaoha...",
  "Nononono...aiiiiiiiiiiiiieeeeeeee....",
  "Aaaaaaaaaghhhhh...woahwoahwoahwoahwoah...",
  "You're eeeeeeeeviiiiiiilllllllll....",
  "Eee...eee...eee...eee...eee...",
  "Woowoowoowoowoowoowoowoowoo..."
];
  
var stop = [
  "Please... never again.",
  "I'm so dizzy.",
  "That's just... cruel.",
  "Don't you have better things to do?",
  "I can't feel my toes... oh wait, I don't have any toes!",
  "This isn't fun anymore.",
  "...",
  "I'm going to be sick.",
  "Uh-oh, I think I just dropped some tables...",
  "Yep, I think I'm about to SQL-project everywhere...",
  "SELECT * FROM `stomach`...",
  "var_dump($result)...",
  "+_+"
];
$('#dave').mousedown(function () {
  
  $('#message').fadeOut(function () {
    $(this).text(spin[presses % spin.length]);
    presses = presses + 1;
  }).fadeIn();
  
}).mouseup(function () {
  
  $('#message').fadeOut(function () {
    $(this).text(stop[presses % stop.length]);
  }).fadeIn();
  
  if( presses >= stop.length - 1 ) {
    $(this).animate({left: '-999px'}, 1000 * 10, function () {
      $(this).animate({left: '0'}, 1000 * 4);
      presses = 0;
    });
  }
  
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers