UNPKG

grunt-doctrine

Version:

Grunt plugin to convert doctrine xml annotations into backbone models and collections. Useful in conjunction with doctrine apigility. Includes option to scaffold an entire BBB application

90 lines (72 loc) 2.14 kB
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>04.Append</title> <link rel="stylesheet" href="../_assets/theme.css"> </head> <body> <!-- Layout will be inserted here. --> <div class="main"></div> <!-- Layout template. --> <script class="template" type="template" id="layout"> <h1>Hello world!</h1> <p></p> </script> <!-- View template --> <script class="template" type="template" id="view"> This is some content... </script> <!-- Display template. --> <script class="template" type="template" id="display"> What a twist! </script> <!-- Dependencies. --> <script src="../../test/vendor/jquery.js"></script> <script src="../../test/vendor/underscore.js"></script> <script src="../../test/vendor/backbone.js"></script> <!-- LayoutManager library. --> <script src="../../backbone.layoutmanager.js"></script> <!-- Example code. --> <script contenteditable="true"> var DisplayView = Backbone.View.extend({ manage: true, template: "#display" }); // Create a View to be used with the Layout below. var View = Backbone.Layout.extend({ template: "#view", // When you click the View contents, it will wrap them in a bold tag. events: { "click": "wrapElement", "mouseenter": "insertElement", "mouseleave": "removeElement" }, wrapElement: function() { this.$el.wrap("<b>"); }, insertElement: function() { this.insertView(new DisplayView()).render(); }, removeElement: function() { // Removes the inserted DisplayView. this.removeView(""); } }); // Create a new Layout. var layout = new Backbone.Layout({ // Attach the Layout to the main container. el: ".main", // Use the previous defined template. template: "#layout", // Declaratively bind a nested View to the Layout. views: { "p": new View() } }); // Render the Layout. layout.render(); </script> </body> </html>