Skip to content

Commit cc5d610

Browse files
tkirda-bisonclaude
andcommitted
docs(pages): move demo into docs/ and serve GitHub Pages from there
Files renamed: - index.htm → docs/index.htm - content/ → docs/content/ - scripts/{countries,demo}.js → docs/scripts/ While moving, modernized docs/index.htm: HTML5 doctype + meta charset, dropped XHTML xmlns / self-closing inputs / text/javascript MIME, fixed `selction-ajax` → `selection-ajax` typo, dropped "DevBridge" from the title, and switched the plugin script from a local dist/ path to the jsdelivr CDN (`@2` tag — follows the latest 2.x release). docs/scripts/demo.js: matching `selction-ajax` fix plus two NHL team name typos (`Edmonton OIlers`, `New Rork Islanders`). UTF-8 BOMs stripped from demo.js, countries.js, styles.css. CLAUDE.md updated to reference the new docs/ layout and note that the demo is also the live Pages site at https://devbridge.github.io/jQuery-Autocomplete/. GitHub Pages source switched from `gh-pages` to `master/docs` (separate config change via API; gh-pages branch already deleted). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9fb7100 commit cc5d610

5 files changed

Lines changed: 24 additions & 23 deletions

File tree

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TypeScript source under `src/` (~700 lines split into ~8 modules) compiles to a
2626
- `npm run test:watch` — Vitest watch mode.
2727
- `npm run lint` — ESLint over `test/` and `scripts/build.mjs`. **TS source is not linted by ESLint**`tsc --noEmit` covers it via the `typecheck` script.
2828
- `npm run typecheck``tsc --noEmit`. Strict mode; runs on `src/`.
29-
- `npm run format` — Prettier rewrite of `src/`, `test/`, and `scripts/build.mjs` (100-col, 4-space, ES5 trailing commas). Demo files under `scripts/` (`countries.js`, `demo.js`) are intentionally excluded.
29+
- `npm run format` — Prettier rewrite of `src/`, `test/`, and `scripts/build.mjs` (100-col, 4-space, ES5 trailing commas). Demo files under `docs/` are intentionally excluded.
3030
- `npm run format:check` — Prettier check-only, same scope. CI gate.
3131
- `npm run build` — runs `scripts/build.mjs` (Node ESM): esbuild emits `dist/jquery.autocomplete.esm.js` (ESM) and `dist/jquery.autocomplete.js` / `.min.js` (UMD, hand-wrapped); `tsc --declaration` emits the `.d.ts` files; the version field in `devbridge-autocomplete.jquery.json` is synced from `package.json`.
3232

@@ -42,7 +42,7 @@ Vitest + jsdom, headless. Specs live in `test/autocomplete.test.js`. `test/setup
4242

4343
To run a single test: `npx vitest run -t "test name substring"` or temporarily `describe.only` / `it.only`.
4444

45-
The demo page `index.htm` is the manual test surface (Ajax lookup, local lookup with grouping, custom container, dynamic width). It loads jQuery + mockjax from CDN; open in a browser.
45+
The demo page `docs/index.htm` is the manual test surface (Ajax lookup, local lookup with grouping, custom container, dynamic width) **and** the live demo published at https://devbridge.github.io/jQuery-Autocomplete/ via GitHub Pages (configured to serve from `master/docs`). It loads jQuery, mockjax, and the plugin itself from CDN (`cdn.jsdelivr.net/npm/devbridge-autocomplete@2/...`); open in a browser.
4646

4747
## Build internals
4848

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
1+
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
22
.container { width: 800px; margin: 0 auto; }
33

44
.autocomplete-suggestions { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<!DOCTYPE html>
2-
<html xmlns="http://www.w3.org/1999/xhtml">
1+
<!DOCTYPE html>
2+
<html lang="en">
33

44
<head>
5-
<title>DevBridge Autocomplete Demo</title>
6-
<link href="content/styles.css" rel="stylesheet" />
5+
<meta charset="utf-8">
6+
<title>Ajax Autocomplete for jQuery &mdash; Demo</title>
7+
<link href="content/styles.css" rel="stylesheet">
78
</head>
89

910
<body>
@@ -14,23 +15,23 @@ <h2>Ajax Lookup</h2>
1415
<p>Type country name in english:</p>
1516
<div style="position: relative; height: 80px;">
1617
<input type="text" name="country" id="autocomplete-ajax"
17-
style="position: absolute; z-index: 2; background: transparent;" />
18+
style="position: absolute; z-index: 2; background: transparent;">
1819
<input type="text" name="country" id="autocomplete-ajax-x" disabled="disabled"
19-
style="color: #CCC; position: absolute; background: transparent; z-index: 1;" />
20+
style="color: #CCC; position: absolute; background: transparent; z-index: 1;">
2021
</div>
21-
<div id="selction-ajax"></div>
22+
<div id="selection-ajax"></div>
2223

2324
<h2>Local Lookup and Grouping</h2>
2425
<p>Type NHL or NBA team name:</p>
2526
<div>
26-
<input type="text" name="country" id="autocomplete" />
27+
<input type="text" name="country" id="autocomplete">
2728
</div>
2829
<div id="selection"></div>
2930

3031
<h2>Custom Lookup Container</h2>
3132
<p>Type country name in english:</p>
3233
<div>
33-
<input type="text" name="country" id="autocomplete-custom-append" style="float: left;" />
34+
<input type="text" name="country" id="autocomplete-custom-append" style="float: left;">
3435
<div id="suggestions-container" style="position: relative; float: left; width: 400px; margin: 10px;"></div>
3536
</div>
3637
</div>
@@ -39,15 +40,15 @@ <h2>Custom Lookup Container</h2>
3940
<h2>Dynamic Width</h2>
4041
<p>Type country name in english:</p>
4142
<div>
42-
<input type="text" name="country" id="autocomplete-dynamic" style="width: 100%; border-width: 5px;" />
43+
<input type="text" name="country" id="autocomplete-dynamic" style="width: 100%; border-width: 5px;">
4344
</div>
4445
</div>
4546

46-
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
47-
<script type="text/javascript" src="https://unpkg.com/jquery-mockjax@2.6.0/dist/jquery.mockjax.js"></script>
48-
<script type="text/javascript" src="dist/jquery.autocomplete.js"></script>
49-
<script type="text/javascript" src="scripts/countries.js"></script>
50-
<script type="text/javascript" src="scripts/demo.js"></script>
47+
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
48+
<script src="https://unpkg.com/jquery-mockjax@2.6.0/dist/jquery.mockjax.js"></script>
49+
<script src="https://cdn.jsdelivr.net/npm/devbridge-autocomplete@2/dist/jquery.autocomplete.js"></script>
50+
<script src="scripts/countries.js"></script>
51+
<script src="scripts/demo.js"></script>
5152
</body>
5253

5354
</html>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var countries = {
1+
var countries = {
22
"AD": "Andorra",
33
"A2": "Andorra Test",
44
"AE": "United Arab Emirates",

scripts/demo.js renamed to docs/scripts/demo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*jslint browser: true, white: true, plusplus: true */
1+
/*jslint browser: true, white: true, plusplus: true */
22
/*global $, countries */
33

44
$(function () {
@@ -36,17 +36,17 @@ $(function () {
3636
return re.test(suggestion.value);
3737
},
3838
onSelect: function(suggestion) {
39-
$('#selction-ajax').html('You selected: ' + suggestion.value + ', ' + suggestion.data);
39+
$('#selection-ajax').html('You selected: ' + suggestion.value + ', ' + suggestion.data);
4040
},
4141
onHint: function (hint) {
4242
$('#autocomplete-ajax-x').val(hint);
4343
},
4444
onInvalidateSelection: function() {
45-
$('#selction-ajax').html('You selected: none');
45+
$('#selection-ajax').html('You selected: none');
4646
}
4747
});
4848

49-
var nhlTeams = ['Anaheim Ducks', 'Atlanta Thrashers', 'Boston Bruins', 'Buffalo Sabres', 'Calgary Flames', 'Carolina Hurricanes', 'Chicago Blackhawks', 'Colorado Avalanche', 'Columbus Blue Jackets', 'Dallas Stars', 'Detroit Red Wings', 'Edmonton OIlers', 'Florida Panthers', 'Los Angeles Kings', 'Minnesota Wild', 'Montreal Canadiens', 'Nashville Predators', 'New Jersey Devils', 'New Rork Islanders', 'New York Rangers', 'Ottawa Senators', 'Philadelphia Flyers', 'Phoenix Coyotes', 'Pittsburgh Penguins', 'Saint Louis Blues', 'San Jose Sharks', 'Tampa Bay Lightning', 'Toronto Maple Leafs', 'Vancouver Canucks', 'Washington Capitals'];
49+
var nhlTeams = ['Anaheim Ducks', 'Atlanta Thrashers', 'Boston Bruins', 'Buffalo Sabres', 'Calgary Flames', 'Carolina Hurricanes', 'Chicago Blackhawks', 'Colorado Avalanche', 'Columbus Blue Jackets', 'Dallas Stars', 'Detroit Red Wings', 'Edmonton Oilers', 'Florida Panthers', 'Los Angeles Kings', 'Minnesota Wild', 'Montreal Canadiens', 'Nashville Predators', 'New Jersey Devils', 'New York Islanders', 'New York Rangers', 'Ottawa Senators', 'Philadelphia Flyers', 'Phoenix Coyotes', 'Pittsburgh Penguins', 'Saint Louis Blues', 'San Jose Sharks', 'Tampa Bay Lightning', 'Toronto Maple Leafs', 'Vancouver Canucks', 'Washington Capitals'];
5050
var nbaTeams = ['Atlanta Hawks', 'Boston Celtics', 'Charlotte Bobcats', 'Chicago Bulls', 'Cleveland Cavaliers', 'Dallas Mavericks', 'Denver Nuggets', 'Detroit Pistons', 'Golden State Warriors', 'Houston Rockets', 'Indiana Pacers', 'LA Clippers', 'LA Lakers', 'Memphis Grizzlies', 'Miami Heat', 'Milwaukee Bucks', 'Minnesota Timberwolves', 'New Jersey Nets', 'New Orleans Hornets', 'New York Knicks', 'Oklahoma City Thunder', 'Orlando Magic', 'Philadelphia Sixers', 'Phoenix Suns', 'Portland Trail Blazers', 'Sacramento Kings', 'San Antonio Spurs', 'Toronto Raptors', 'Utah Jazz', 'Washington Wizards'];
5151
var nhl = $.map(nhlTeams, function (team) { return { value: team, data: { category: 'NHL' }}; });
5252
var nba = $.map(nbaTeams, function (team) { return { value: team, data: { category: 'NBA' } }; });

0 commit comments

Comments
 (0)