HTML Markup | JavaScript | Java | Home & Links
JR's HomePage | JavaScript Home | Site Map | Page Bottom
Client-Side Site Search Engine | DataBase Engine
Event Calendar | Simple Slide Show

JavaScript Projects [Large]

This area is for large JS projects that I have either developed or ripped the script and heavily modified. The projects have been tested and thoroughly documented. Be sure to check Short Projects, Form Projects and Webpage Effects pages for ideas.

Client-Side Site Search Engine

A client-side site search engine does not require cgi scripts (which your ISP may be reluctant to let you install) or any off-shore cooperation. This site uses a heavily modified adaptation of the Tipue search engine. Some of the features are: it works on all browsers, it is easy to install and it supports the - [exclude this word], OR and NOT keywords in a search pattern. My modifications include control value access by ID, modern syntax and changes to allow validation with jsLint.

Installing the Site Search Engine

Database Engine

A client-side database engine does not require cgi scripts (which your ISP may be reluctant to let you install) or off-shore cooperation. It also allows ranges of numeric data as well as exact or partial string matches. JSDB is my homebrew search engine that is free for your own use. A typical application would be a Real Estate Finder where a specific location but a range of values is wanted. External files for longer descriptions and photos are provided for.

JSDB contains two HTML modules (jsdb_frm and jsdb_rpt) and a database (jsdb_db) in JavaScript. jsdb_frm is the query selection component which uses HTML selection boxes to gather the request and pass it through session cookies to the jsdb_rpt report generator. The generator has a find match function and its results can then be used to display various components of any records found. Records can also contain fields that are pointers to external files.

 

The steps in adapting this database system is:

One extension to the database project would be to add selectable field reporting.

Event Calendar

Event calendars are very useful for reminding clients of important dates and adding information to commercial sites. evtcal, written by Clark Hay and packaged by JavaScriptKit.com looks great and offers flexible scheduling. I found that the coding needed a bit of improvement. Check out JR's revised version or Dansations. The changes made in my version are as follows:

  1. A display problem that occured only in Opera is fixed and the script tweaked to verify with jsLint.
  2. Content, function and styling required separation to allow rapid customization.
  3. Extracted documentation into a separate file (eventhlp.txt) for notes on folder pointers and
    flags, styling (including unique event links). the events database and internationalization.
  4. Image pointers and folders were relabeled to allow additional formats (eg iconic) and scalings.
    For example folder 40e contains 40 pixel images in English and 20i contains 20 pixel
    iconic images for multilingual usage.
  5. Added the capability to set unique classnames for special events.
  6. Changed the event display area to one that can have styled text. Textareas lack that capability.
  7. Added floating dates for last of month occurance. This affects Memorial Day for U.S. calendars
    and other events in international ones.
  8. Added recurring monthly events for events that occur on a set date each month.
  9. Start/end dates can be defined for recurring events.
  10. Month/Year captions can be split over two lines for compact yet readable displays.
  11. The fixedSize variable determines whether number of weeks shown is fixed at 6
    or only as many as needed (sometimes 4 or 5).
  12. Navigation button tooltip captions can be set using JS variables.
    Setting these variables to empty strings hides them (except in Opera).
  13. Date captions (month and day) can be redefined in another language in the events database.
  14. The event message display area was modified for readability and less US-centric date formatting.
  15. The original events database module (relabeled as eventsus.js) assumes American holidays.
    An alternate module (eventsca.js) contains Canadian holidays and spelling.

There are also improvements waiting to be done. These include:

  1. adding validity checking for the database record fields.
  2. setting floating events to a 'closest' weekday for some countries.

 

Simple Slide Show [S3]

S3 can help authors who prefer to design and build their own slideshow that includes only the features they need. The basic requirements are: a set of slides (aka slideTray), a display area (aka screen) and a sequencer (aka projector). The slideTray is an array var. The screen is an img element. Sequencing can be a simple next button with an onclick event or a timer.

When timers are used, there is also a need to stop or escape them. In slideshows, a manual advance to the next slide is a typical situation. To escape a timer, its setTimeout() function is assigned to a handle variable which can then be used by a clearTimeout() method. The code for stopTimer() shows how this is done.

Suggested enhancements include slide captions, background audio and transitions. The following example uses the CSS opacity method [see fadeIn(), initImage() & initImageFade()]. holderId contains the old image. imageId contains the new one. Screen is the screen image id. Elements may need styling. Don't forget to add showTimer() to the onload event.
Note: The fade improvement does not work in all browsers!

[]

An older slideshow project that needs some work but exhibits a few basic principles and includes background audio!


JR's HomePage | Comments [jsproj.htm:2010 11 28]