├── .repo-rt ├── css ├── basic.css └── enhanced.css ├── js ├── example.js └── jQuery.tree.js ├── images ├── icon-file.gif ├── icon-folder.gif └── icon-folder-open.gif ├── extra-example-jqtheming ├── images │ ├── icon-file.gif │ ├── icon-folder.gif │ └── icon-folder-open.gif ├── css │ └── enhanced.css ├── js │ └── example.js └── index.html ├── README.md ├── license.txt └── index.html /.repo-rt: -------------------------------------------------------------------------------- 1 | RETIRED 2 | -------------------------------------------------------------------------------- /css/basic.css: -------------------------------------------------------------------------------- 1 | body { font-family: "Segoe UI", Arial, sans-serif; } -------------------------------------------------------------------------------- /js/example.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $('#files').tree({ 3 | expanded: 'li:first' 4 | }); 5 | }); -------------------------------------------------------------------------------- /images/icon-file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/images/icon-file.gif -------------------------------------------------------------------------------- /images/icon-folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/images/icon-folder.gif -------------------------------------------------------------------------------- /images/icon-folder-open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/images/icon-folder-open.gif -------------------------------------------------------------------------------- /extra-example-jqtheming/images/icon-file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/extra-example-jqtheming/images/icon-file.gif -------------------------------------------------------------------------------- /extra-example-jqtheming/images/icon-folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/extra-example-jqtheming/images/icon-folder.gif -------------------------------------------------------------------------------- /extra-example-jqtheming/images/icon-folder-open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filamentgroup/jQuery-Tree-Control/HEAD/extra-example-jqtheming/images/icon-folder-open.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :warning: This project is archived and the repository is no longer maintained. 2 | 3 | # Code Examples from the book [Designing with Progressive Enhancement](http://filamentgroup.com/dwpe) 4 | 5 | [ ](http://www.filamentgroup.com/) 6 | 7 | This repository includes open-sourced code developed and maintained by Filament Group, Inc. as part of the book "Designing With Progressive Enhancement" (Peachpit). 8 | 9 | All examples use the [jQuery JavaScript library](http://jquery.com). 10 | 11 | These code examples use the [EnhanceJS framework](https://github.com/filamentgroup/EnhanceJS) for applying progressive enhancement based on browser capabilities testing. 12 | -------------------------------------------------------------------------------- /extra-example-jqtheming/css/enhanced.css: -------------------------------------------------------------------------------- 1 | /*note: file modified to remove colors, backgrounds, borders for jQuery UI theming */ 2 | body { font-size:62.5%; margin:20px; } 3 | #files { margin:2em 0 5em; width:400px; } 4 | .tree { font-size:1.5em; } 5 | .tree,.tree ul,.tree li { list-style:none; margin:0; padding:0; zoom: 1; } 6 | .tree ul { margin-left:8px; } 7 | .tree li a { color:#555; padding:.1em 7px .1em 27px; display:block; text-decoration:none; border:1px dashed #fff; } 8 | .tree ul.tree-group-collapsed { display:none; } 9 | 10 | /*theme additions*/ 11 | #files { border: none; padding: 0; background: none; } 12 | .tree li a { position: relative; padding:.4em 7px .4em 20px; border:1px dashed transparent; } 13 | .ui-icon { position: absolute; left: 4px; top: 50%; margin-top: -8px; } -------------------------------------------------------------------------------- /css/enhanced.css: -------------------------------------------------------------------------------- 1 | body { font-size:62.5%; margin:20px; } 2 | #files { margin:2em 0 5em; width:400px; } 3 | .tree { font-size:1.5em; } 4 | .tree,.tree ul,.tree li { list-style:none; margin:0; padding:0; zoom: 1; } 5 | .tree ul { margin-left:8px; } 6 | .tree li a { color:#555; padding:.1em 7px .1em 27px; display:block; text-decoration:none; border:1px dashed #fff; background:url(../images/icon-file.gif) 5px 50% no-repeat; } 7 | .tree li a.tree-parent { background:url(../images/icon-folder-open.gif) 5px 50% no-repeat; } 8 | .tree li a.tree-parent-collapsed { background:url(../images/icon-folder.gif) 5px 50% no-repeat; } 9 | .tree li a:hover,.tree li a.tree-parent:hover,.tree li a:focus,.tree li a.tree-parent:focus,.tree li a.tree-item-active { color:#000; border:1px solid#eee; background-color:#fafafa; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; } 10 | .tree li a:focus,.tree li a.tree-parent:focus,.tree li a.tree-item-active { border:1px solid #e2f3fb; background-color:#f2fafd; } 11 | .tree ul.tree-group-collapsed { display:none; } -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Filament Group, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /extra-example-jqtheming/js/example.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $('#files').tree({ 3 | expanded: 'li:first' 4 | }); 5 | 6 | //Scripting to add UI icons and behavior 7 | $('.tree') 8 | .addClass('ui-widget ui-widget-content') 9 | .bind('expand',function(event){ 10 | var target = $(event.target) || $(this).find('a[tabindex=0]'); 11 | target.find('span:eq(0)').addClass('ui-icon-folder-open'); 12 | return false; 13 | }) 14 | .bind('collapse',function(event){ 15 | var target = $(event.target) || $(this).find('a[tabindex=0]'); 16 | target.find('span:eq(0)').removeClass('ui-icon-folder-open'); 17 | return false; 18 | }) 19 | .focus(function(event){ 20 | //deactivate previously active tree node, if one exists 21 | $(this).find('.ui-state-highlight').removeClass('ui-state-highlight'); 22 | //assign 0 tabindex to focused item 23 | $(event.target).addClass('ui-state-highlight'); 24 | }) 25 | .find('a') 26 | .addClass('ui-corner-all') 27 | .hover(function(){ 28 | $(this).addClass('ui-state-hover'); 29 | },function(){ 30 | $(this).removeClass('ui-state-hover'); 31 | }) 32 | .not('.tree-parent') 33 | .prepend('') 34 | .end() 35 | .filter('.tree-parent') 36 | .prepend('') 37 | .not('.tree-parent-collapsed') 38 | .find('span:eq(0)').addClass('ui-icon-folder-open'); 39 | 40 | 41 | //add theme switcher tool for demo purposes 42 | $('
').prependTo('body').themeswitcher(); 43 | }); -------------------------------------------------------------------------------- /extra-example-jqtheming/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |