This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sencha Touch</title> | |
| <link rel="stylesheet" href="sencha/097/ext-touch-debug.css" type="text/css"> | |
| <link rel="stylesheet" href="stylesheets/scratch.css" type="text/css" media="screen" title="no title" charset="utf-8"/> | |
| <script type="text/javascript" src="sencha/097/ext-touch-debug.js"> </script> | |
| <script src="javascripts/data.js" type="text/javascript" charset="utf-8"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tpl = new Ext.XTemplate( | |
| '<p>Name: {name}</p>', | |
| '<p>Kids: ', | |
| '<tpl for="kids">', | |
| '<tpl if="this.isGirl(name)">', | |
| '<p>Girl: {name} - {age}</p>', | |
| '</tpl>', | |
| // use opposite if statement to simulate 'else' processing: | |
| '<tpl if="this.isGirl(name) == false">', | |
| '<p>Boy: {name} - {age}</p>', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tpl = Ext.XTemplate.from('kids-list'); | |
| tpl.isGirl = function(name){ | |
| return name == 'Sara Grace'; | |
| } | |
| tpl.isBaby: function(age){ | |
| return age < 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var templateFunctions = { | |
| renderImage: function(images) { | |
| if (Ext.isArray(images) && images[2]) { | |
| var img = images[2]; | |
| return String.format('<img src="{0}" />', img.url, img.width, img.height); | |
| } else { | |
| return ''; | |
| } | |
| }, | |
| renderPrice: function(price, values) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| landscapeProductTpl: new Ext.XTemplate( | |
| '<div class="productlist-container">', | |
| '<tpl for=".">', | |
| '<span>{price:this.renderPrice} - {retailer}</span>', | |
| '</tpl>', | |
| '</div>', | |
| renderPrice: function(price, values) { | |
| var salePrice = values.salePrice; | |
| if (salePrice) { | |
| return '<del>' + values.priceLabel + '</del> ' + values.salePriceLabel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| demos.TouchImpl.TouchPad = Ext.extend(Ext.Component, { | |
| id: 'touchpad', | |
| html: 'Touch here!', | |
| initComponent : function() { | |
| this.addEvents('log'); | |
| demos.TouchImpl.TouchPad.superclass.initComponent.call(this); | |
| }, | |
| afterRender: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.setup({ | |
| onReady: function() { | |
| var data = [{ | |
| name: 'Joshua', | |
| age:3 | |
| },{ | |
| name: 'Matthew', | |
| age:2 | |
| },{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if has("autocmd") | |
| autocmd FileType ruby nnoremap <buffer> <D-r> :!ruby %<CR> | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if has("autocmd") | |
| autocmd FileType ruby :Abolish -buffer initialise initialize | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| command! -nargs=* Only call CloseHiddenBuffers() | |
| function! CloseHiddenBuffers() | |
| " figure out which buffers are visible in any tab | |
| let visible = {} | |
| for t in range(1, tabpagenr('$')) | |
| for b in tabpagebuflist(t) | |
| let visible[b] = 1 | |
| endfor | |
| endfor | |
| " close any buffer that are loaded and not visible |