source: trunk/web/addons/job_monarch/lib/extjs/examples/samples.js @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 17.3 KB
Line 
1/*
2 * Ext JS Library 2.2.1
3 * Copyright(c) 2006-2009, Ext JS, LLC.
4 * licensing@extjs.com
5 *
6 * http://extjs.com/license
7 */
8
9SamplePanel = Ext.extend(Ext.DataView, {
10    autoHeight: true,
11    frame:true,
12    cls:'demos',
13    itemSelector: 'dd',
14    overClass: 'over',
15   
16    tpl : new Ext.XTemplate(
17        '<div id="sample-ct">',
18            '<tpl for=".">',
19            '<div><a name="{id}"></a><h2><div>{title}</div></h2>',
20            '<dl>',
21                '<tpl for="samples">',
22                    '<dd ext:url="{url}"><img src="shared/screens/{icon}"/>',
23                        '<div><h4>{text}</h4><p>{desc}</p></div>',
24                    '</dd>',
25                '</tpl>',
26            '<div style="clear:left"></div></dl></div>',
27            '</tpl>',
28        '</div>'
29    ),
30
31    onClick : function(e){
32        var group = e.getTarget('h2', 3, true);
33        if(group){
34            group.up('div').toggleClass('collapsed');
35        }else {
36            var t = e.getTarget('dd', 5, true);
37            if(t && !e.getTarget('a', 2)){
38                var url = t.getAttributeNS('ext', 'url');
39                window.open(url);
40            }
41        }
42        return SamplePanel.superclass.onClick.apply(this, arguments);
43    }
44});
45
46
47Ext.EventManager.on(window, 'load', function(){
48
49    var catalog = [{
50        title: 'Combination Samples',
51        samples: [{
52            text: 'Feed Viewer 2.0',
53            url: 'feed-viewer/view.html',
54            icon: 'feeds.gif',
55            desc: 'RSS 2.0 feed reader sample application that features a swappable reader panel layout.'
56        },{
57            text: 'Simple Tasks 2.0',
58            url: 'http://extjs.com/blog/2008/02/24/tasks2/',
59            icon: 'air.gif',
60            desc: 'Complete personal task management application sample that runs on <a href="http://labs.adobe.com/technologies/air/" target="_blank">Adobe AIR</a>.'
61        },{
62            text: 'Simple Tasks',
63            url: 'tasks/tasks.html',
64            icon: 'tasks.gif',
65            desc: 'Personal task management application sample that uses <a href="http://gears.google.com" target="_blank">Google Gears</a> for data storage.'
66        },{
67            text: 'Image Organizer',
68            url: 'organizer/organizer.html',
69            icon: 'organizer.gif',
70            desc: 'DataView and TreePanel sample that demonstrates dragging data items from a DataView into a TreePanel.'
71        },{
72            text: 'Web Desktop',
73            url: 'desktop/desktop.html',
74            icon: 'desktop.gif',
75            desc: 'Demonstrates how one could build a desktop in the browser using Ext components including a module plugin system.'
76        }]
77    },{
78        title: 'Grids',
79        samples: [{
80            text: 'Basic Array Grid',
81            url: 'grid/array-grid.html',
82            icon: 'grid-array.gif',
83            desc: 'A basic read-only grid loaded from local array data that demonstrates the use of custom column renderer functions.'
84        },{
85            text: 'Editable Grid',
86            url: 'grid/edit-grid.html',
87            icon: 'grid-edit.gif',
88            desc: 'An editable grid loaded from XML that shows multiple types of grid editors as well as defining custom data records.'
89        },{
90            text: 'XML Grid',
91            url: 'grid/xml-grid.html',
92            icon: 'grid-xml.gif',
93            desc: 'A simple read-only grid loaded from XML data.'
94        },{
95            text: 'Paging',
96            url: 'grid/paging.html',
97            icon: 'grid-paging.gif',
98            desc: 'A grid with paging, cross-domain data loading and custom- rendered expandable row bodies.'
99        },{
100            text: 'Grouping',
101            url: 'grid/grouping.html',
102            icon: 'grid-grouping.gif',
103            desc: 'A basic grouping grid showing collapsible data groups that can be customized via the "Group By" header menu option.'
104        },{
105            text: 'Live Group Summary',
106            url: 'grid/totals.html',
107            icon: 'grid-summary.gif',
108            desc: 'Advanced grouping grid that allows cell editing and includes custom dynamic summary calculations.'
109        },{
110            text: 'Grid Plugins',
111            url: 'grid/grid3.html',
112            icon: 'grid-plugins.gif',
113            desc: 'Multiple grids customized via plugins: expander rows, checkbox selection and row numbering.'
114        },{
115            text: 'Grid Filtering',
116            url: 'grid-filtering/grid-filter.html',
117            icon: 'grid-filter.gif',
118            desc: 'Grid plugins providing custom data filtering menus that support various data types.'
119        },{
120            text: 'Grid From Markup',
121            url: 'grid/from-markup.html',
122            icon: 'grid-from-markup.gif',
123            desc: 'Custom GridPanel extension that can convert a plain HTML table into a dynamic grid at runtime.'
124        },{
125            text: 'Grid Data Binding (basic)',
126            url: 'grid/binding.html',
127            icon: 'grid-data-binding.gif',
128            desc: 'Data binding a grid to a detail preview panel via the grid\'s RowSelectionModel.'
129        },{
130            text: 'Grid Data Binding (advanced)',
131            url: 'grid/binding-with-classes.html',
132            icon: 'grid-data-binding.gif',
133            desc: 'Refactoring the basic data binding example to use a class-based application design model.'
134        }]
135    },{
136        title: 'Tabs',
137        samples: [{
138            text: 'Basic Tabs',
139            url: 'tabs/tabs.html',
140            icon: 'tabs.gif',
141            desc: 'Basic tab functionality including autoHeight, tabs from markup, Ajax loading and tab events.'
142        },{
143            text: 'Advanced Tabs',
144            url: 'tabs/tabs-adv.html',
145            icon: 'tabs-adv.gif',
146            desc: 'Advanced tab features including tab scrolling, adding tabs programmatically and a context menu plugin.'
147        }]
148    },{
149        title: 'Windows',
150        samples: [{
151            text: 'Hello World',
152            url: 'window/hello.html',
153            icon: 'window.gif',
154            desc: 'Simple "Hello World" window that contains a basic TabPanel.'
155        },{
156            text: 'MessageBox',
157            url: 'message-box/msg-box.html',
158            icon: 'msg-box.gif',
159            desc: 'Different styles include confirm, alert, prompt, progress and wait and also support custom icons.'
160        },{
161            text: 'Layout Window',
162            url: 'window/layout.html',
163            icon: 'window-layout.gif',
164            desc: 'A window containing a basic BorderLayout with nested TabPanel.'
165        }]
166    },{
167        title: 'Trees',
168        samples: [{
169            text: 'Drag and Drop Reordering',
170            url: 'tree/reorder.html',
171            icon: 'tree-reorder.gif',
172            desc: 'A TreePanel loaded asynchronously via a JSON TreeLoader that shows drag and drop with container scroll.'
173        },{
174            text: 'Multiple trees',
175            url: 'tree/two-trees.html',
176            icon: 'tree-two.gif',
177            desc: 'Drag and drop between two different sorted TreePanels.'
178        },{
179            text: 'Column Tree',
180            url: 'tree/column-tree.html',
181            icon: 'tree-columns.gif',
182            desc: 'A custom TreePanel implementation that demonstrates extending an existing component.'
183        },{
184            text: 'XML Tree Loader',
185            url: 'tree/xml-tree-loader.html',
186            icon: 'tree-xml-loader.gif',
187            desc: 'A custom TreeLoader implementation that demonstrates loading a tree from an XML document.'
188        }]
189    },{
190        title: 'Layout Managers',
191        samples: [{
192            text: 'Layout Browser',
193            url: 'layout-browser/layout-browser.html',
194            icon: 'layout-browser.gif',
195            desc: 'Includes examples for each standard Ext layout, several custom layouts and combination examples.'
196        },{
197            text: 'Border Layout',
198            url: 'layout/complex.html',
199            icon: 'border-layout.gif',
200            desc: 'A complex BorderLayout implementation that shows nesting multiple components and sub-layouts.'
201        },{
202            text: 'Anchor Layout',
203            url: 'form/anchoring.html',
204            icon: 'anchor.gif',
205            desc: 'A simple example of anchoring form fields to a window for flexible form resizing.'
206        },{
207            text: 'Portal Demo',
208            url: 'portal/portal.html',
209            icon: 'portal.gif',
210            desc: 'A page layout using several custom extensions to provide a web portal interface.'
211        }]
212    },{
213        title: 'ComboBox',
214        samples: [{
215            text: 'Basic ComboBox',
216            url: 'form/combos.html',
217            icon: 'combo.gif',
218            desc: 'Basic combos, combos rendered from markup and customized list layout to provide item tooltips.'
219        },{
220            text: 'ComboBox Templates',
221            url: 'form/forum-search.html',
222            icon: 'combo-custom.gif',
223            desc: 'Customized combo with template-based list rendering, remote loading and paging.'
224        }]
225    },{
226        title: 'Forms',
227        samples: [{
228            text: 'Dynamic Forms',
229            url: 'form/dynamic.html',
230            icon: 'form-dynamic.gif',
231            desc: 'Various example forms showing collapsible fieldsets, column layout, nested TabPanels and more.'
232        },{
233            text: 'Ajax with XML Forms',
234            url: 'form/xml-form.html',
235            icon: 'form-xml.gif',
236            desc: 'Ajax-loaded form fields from remote XML data and remote field validation on submit.'
237        },{
238            text: 'Custom Search Field',
239            url: 'form/custom.html',
240            icon: 'form-custom.gif',
241            desc: 'A TriggerField search extension combined with an XTemplate for custom results rendering.'
242        },{
243            text: 'Binding a Grid to a Form',
244            url: 'form/form-grid.html',
245            icon: 'form-grid-binding.gif',
246            desc: 'A grid embedded within a FormPanel that automatically loads records into the form on row selection.'
247        },{
248            text: 'Advanced Validation',
249            url: 'form/adv-vtypes.html',
250            icon: 'form-adv-vtypes.gif',
251            desc: 'Relational form field validation using custom vtypes.'
252        },{
253            text: 'Checkbox/Radio Groups',
254            url: 'form/check-radio.html',
255            icon: 'form-check-radio.gif',
256            desc: 'Many examples showing different checkbox and radio group configurations.'
257        },{
258            text: 'File Upload Field',
259            url: 'form/file-upload.html',
260            icon: 'form-file-upload.gif',
261            desc: 'A demo of how to give standard file upload fields a bit of Ext style using a custom class.'
262        },{
263            text: 'MultiSelect and ItemSelector',
264            url: 'multiselect/multiselect-demo.html',
265            icon: 'form-multiselect.gif',
266            desc: 'Example controls for selecting a list of items in forms.'
267        }]
268    },{
269        title: 'Toolbars and Menus',
270        samples: [{
271            text: 'Basic Toolbar',
272            url: 'menu/menus.html',
273            icon: 'toolbar.gif',
274            desc: 'Toolbar and menus that contain various components like date pickers, color pickers, sub-menus and more.'
275        },{
276            text: 'Ext Actions',
277            url: 'menu/actions.html',
278            icon: 'toolbar-actions.gif',
279            desc: 'Bind the same behavior to multiple buttons, toolbar and menu items using the Ext.Action class.'
280        }]
281    },{
282        title: 'Templates and DataView',
283        samples: [{
284            text: 'Templates',
285            url: 'core/templates.html',
286            icon: 'templates.gif',
287            desc: 'A simple example of rendering views from templates bound to data objects.'
288        },{
289            text: 'DataView',
290            url: 'view/data-view.html',
291            icon: 'data-view.gif',
292            desc: 'A basic DataView with custom plugins for editable labels and drag selection of items.'
293        },{
294            text: 'DataView (advanced)',
295            url: 'view/chooser.html',
296            icon: 'chooser.gif',
297            desc: 'A more customized DataView supporting sorting and filtering with multiple templates.'
298        }]
299    },{
300                title   : 'Drag and Drop',
301                samples :  [{
302                        text : 'Grid to Grid Drag and Drop',
303                        url  : 'dd/dnd_grid_to_grid.html',
304                        icon : 'dd-gridtogrid.gif',
305                        desc : 'A simple drag and drop from grid to grid implementation.'
306        },{
307                        text : 'Grid to FormPanel Drag and Drop',
308                        url  : 'dd/dnd_grid_to_formpanel.html',
309                        icon : 'dd-gridtoformpanel.gif',
310                        desc : 'A basic drag and drop from grid to formpanel.'
311        },{
312                        text : 'Custom Drag and Drop',
313                        url  : 'dd/dragdropzones.html',
314                        icon : 'dd-zones.gif',
315                        desc : 'Enabling drag and drop between a DataView and a grid using DragZone and DropZone extensions.'
316        }]
317        },{
318        title: 'Miscellaneous',
319        samples: [{
320            text: 'History',
321            url: 'history/history.html',
322            icon: 'history.gif',
323            desc: 'A History manager that allows the user to navigate an Ext UI via browser back/forward.'
324        },{
325            text: 'Google Maps',
326            url: 'window/gmap.html',
327            icon: 'gmap-panel.gif',
328            desc: 'A Google Maps wrapper class that enables easy display of dynamic maps in Ext panels and windows.'
329        },{
330            text: 'StatusBar',
331            url: 'statusbar/statusbar-demo.html',
332            icon: 'statusbar.gif',
333            desc: 'A simple StatusBar that can be dropped into the bottom of any panel to display status text and icons.'
334        },{
335            text: 'StatusBar (advanced)',
336            url: 'statusbar/statusbar-advanced.html',
337            icon: 'statusbar-plugin.gif',
338            desc: 'Customizing the StatusBar via a plugin to provide automatic form validation monitoring and error linking.'
339       },{
340            text: 'Slider',
341            url: 'slider/slider.html',
342            icon: 'slider.gif',
343            desc: 'A slider component that supports vertical mode, snapping, tooltips, customized styles and more.'
344        },{
345            text: 'QuickTips',
346            url: 'simple-widgets/qtips.html',
347            icon: 'qtips.gif',
348            desc: 'Various tooltip and quick tip configuration options including Ajax loading and mouse tracking.'
349        },{
350            text: 'Progress Bar',
351            url: 'simple-widgets/progress-bar.html',
352            icon: 'progress.gif',
353            desc: 'A basic progress bar component shown in various configurations and with custom styles.'
354        },{
355            text: 'Panels',
356            url: 'panel/panels.html',
357            icon: 'panel.gif',
358            desc: 'A basic collapsible panel example.'
359        },{
360            text: 'Resizable',
361            url: 'resizable/basic.html',
362            icon: 'resizable.gif',
363            desc: 'Examples of making any element resizable with various configuration options.'
364        },{
365            text: 'Spotlight',
366            url: 'core/spotlight.html',
367            icon: 'spotlight.gif',
368            desc: 'A utility for masking everything except a single element on the page to visually highlight it.'
369        },{
370            text: 'Localization (static)',
371            url: 'locale/dutch-form.html',
372            icon: 'locale-dutch.gif',
373            desc: 'Demonstrates fully localizing a form by including a custom locale script.'
374        },{
375            text: 'Localization (dynamic)',
376            url: 'locale/multi-lang.html',
377            icon: 'locale-switch.gif',
378            desc: 'Dynamically render various Ext components in different locales by selecting from a locale list.'
379        }]
380    }];
381
382    for(var i = 0, c; c = catalog[i]; i++){
383        c.id = 'sample-' + i;
384    }
385
386    var store = new Ext.data.JsonStore({
387        idProperty: 'id',
388        fields: ['id', 'title', 'samples'],
389        data: catalog
390    });
391
392    new Ext.Panel({
393        autoHeight: true,
394        collapsible: true,
395        frame: true,
396        title: 'View Samples',
397        items: new SamplePanel({
398            store: store
399        })
400    }).render('all-demos');
401
402    var tpl = new Ext.XTemplate(
403        '<tpl for="."><li><a href="#{id}">{title:stripTags}</a></li></tpl>'
404    );
405    tpl.overwrite('sample-menu', catalog);
406
407    Ext.select('#sample-spacer').remove();
408
409    setTimeout(function(){
410        Ext.get('loading').remove();
411        Ext.fly('loading-mask').fadeOut({
412                        remove:true,
413                        callback : function() {
414                                var cp = new Ext.state.CookieProvider();
415
416                                if(window.console && window.console.firebug && ! cp.get('hideFBWarning')){
417                                        var tpl = new Ext.Template(
418                                                '<div style="border: 1px solid #FF0000; background-color:#FFAAAA; display:none; padding:15px; color:#000000;"><b>Warning: </b> Firebug is known to cause performance issues with Ext JS. <a href="#" id="hideWarning">[ Hide ]</a></div>'                         
419                                        );
420                                        var newEl = tpl.insertFirst('all-demos');
421                                       
422                                        Ext.fly('hideWarning').on('click', function() {
423                                                Ext.fly(newEl).slideOut('t',{remove:true});
424                                                cp.set('hideFBWarning', true); 
425                                        });
426                                        Ext.fly(newEl).slideIn();
427                                }
428                               
429                               
430                        }
431               
432               
433                });
434    }, 250);
435
436});
Note: See TracBrowser for help on using the repository browser.