swfobject_modified.js

🌟 Modified SWFObject v2.0 library for embedding Adobe Flash content in a cross-browser, cross-platform manner. It handles plugin detection, dynamic SWF insertion, Express Install fallback, and alternative HTML content when Flash is unavailable .

Browser & Plugin Detection

A centralized feature-detection module builds a ua object:

Property Description
w3cdom W3C DOM support
pv Flash Player version as [major, minor, release]
webkit WebKit engine version or false
ie Internet Explorer flag
win, mac Operating system flags
var ua = (function() {
  // Detect DOM, Flash plugin via navigator.plugins or ActiveXObject
  return { w3cdom, pv:playerVersion, webkit, ie, win, mac };
})();

DOM & Load Event Handling

  • onDomLoad: Fires main() as soon as the DOM is ready in modern browsers, IE (via deferred script), WebKit (via readyState polling), or DOMContentLoaded.
  • addDomLoadEvent(fn) / addLoadEvent(fn): Queue functions for DOM ready or full page load.
addDomLoadEvent(main);
addLoadEvent(callDomLoadFunctions);

Main Embedding Logic

  1. Static Publishing: On DOM load or window load, loop through registered objects (regObjArr).
  2. Version Matching: If installed Flash β‰₯ required version, show SWF; else if Express Install conditions met, trigger installation UI; otherwise, swap in alternative content.
  3. Visibility Control: Uses dynamic CSS injection or inline style to hide/show elements pre- and post-insertion.
function main() {
  regObjArr.forEach(reg => {
    if (hasPlayerVersion(reg.swfVersion)) createSWF(...);
    else displayAltContent(getElementById(reg.id));
  });
}

Express Install & Alternative Content

  • Express Install: showExpressInstall(regObj) replaces original object with Adobe’s installer SWF and restores original content via expressInstallCallback().
  • Alternative Content: abstractAltContent(obj) clones nested HTML to display when Flash is missing or too old.

Dynamic SWF Creation

createSWF(attObj, parObj, id) handles three cases:

  1. IE/ActiveX: Uses outerHTML to build <object> and <param> tags.
  2. Older WebKit: Falls back to <embed>.
  3. Standards Browsers: Creates <object type="application/x-shockwave-flash"> with nested <param> elements.
var o = createElement("object");
o.setAttribute("type", FLASH_MIME_TYPE);
Object.keys(attObj).forEach(k => o.setAttribute(k, attObj[k]));
Object.keys(parObj).forEach(n => createObjParam(o, n, parObj[n]));
el.parentNode.replaceChild(o, el);

Public API

Method Description
registerObject(id, version, xi) Static publishing: hide element and queue for Flash version check.
getObjectById(id) Retrieve embedded SWF or <object> element for scripting.
embedSWF(...) Dynamic publishing: insert SWF at replaceElemIdStr with width, height, flashvars.
getFlashPlayerVersion() Returns { major, minor, release }.
hasFlashPlayerVersion(ver) Alias for hasPlayerVersion(rv).
createSWF(att, par, id) Expose dynamic SWF creation outside the module.
createCSS(sel, decl) Inject CSS rules at runtime.
addDomLoadEvent(fn) Queue function for DOM ready.
addLoadEvent(fn) Queue function for full page load.
getQueryParamValue(param) Read URL query or hash parameter.
expressInstallCallback() Restore original content after Express Install completes.

bootstrap-validation.js

Built-in HTML5 form validation support for Bootstrap-style forms. It prevents invalid submissions and toggles the was-validated class on each form .

document.addEventListener('DOMContentLoaded', () => {
  const forms = document.querySelectorAll('form');
  Array.from(forms).forEach(form => {
    form.addEventListener('submit', event => {
      if (!form.checkValidity()) {
        event.preventDefault();
        event.stopPropagation();
      }
      form.classList.add('was-validated');
    }, false);
  });
});

ddsmoothmenu.js

Dynamic Drive Smooth Navigational Menu offering multi-level, animated drop-down menus with optional shadows and custom themes .

  • Arrow Images: arrowimages.down & arrowimages.right.
  • Transition: transition.overtime and transition.outtime.
  • Shadow: shadow.enable, shadow.offsetx/y.
  • Show/Hide Delay: showhidedelay.showdelay & hidedelay.
  • Initialization: ddsmoothmenu.init({ mainmenuid, orientation, contentsource, customtheme }).
ddsmoothmenu.init({
  mainmenuid: "menu",
  orientation: "h",
  showhidedelay: { showdelay: 200, hidedelay: 200 }
});

function.js

General UI utilities and interactive behaviors powered by jQuery :

  • πŸ†™ Back-to-Top: .btn-backTop scrolls the page to top.
  • πŸ›‘ reCAPTCHA Scaling: Auto-scales .g-recaptcha if its container’s width < 302px.
  • ✨ Scroll Animations: Toggles .animatableβ†’.animated when elements enter viewport.
  • πŸ“± Responsive Class Toggle: Adjust .fa-track-shipment classes on window resize.
  • πŸ”„ Accordion: .accordion-toggle slide-toggles .mw-collapse.
  • πŸ“‡ Contact Icon: .contact_icon slide-toggles .abc.
  • 🎠 Logo Carousel: Initializes Slick slider on .customer-logos.
$('.btn-backTop').click(() => {
  $('html,body').animate({ scrollTop: 0 }, 800);
  return false;
});
$('.customer-logos').slick({ slidesToShow: 7, autoplay: true, responsive: [...] });

nav-scroll.js

πŸ”½ Hide or reveal an element (e.g., header) on vertical scroll :

let prevScrollpos = window.pageYOffset;
window.onscroll = () => {
  let currentScrollPos = window.pageYOffset;
  const el = document.getElementById("hideOnScroll");
  if (prevScrollpos < currentScrollPos) el.classList.add("topHide");
  else el.classList.remove("topHide");
  prevScrollpos = currentScrollPos;
};

sprintf.js

A JavaScript sprintf emulation of C’s printf formatting, supporting flags, width, precision, and types (s, d, f, x, etc.) .

sprintf("%04d", 25);    // "0025"
sprintf("[%'#10s]", "hi");  // "[########hi]"

Key internal functions:

  • pad(str, len, chr, leftJustify)
  • justify(value, prefix, leftJustify, minWidth, zeroPad)
  • formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad)
  • createObjParam(el, name, value)

base64.js

πŸ“¦ Base64 encoder/decoder by Fred Palmer, with UTF-8 support :

Base64.encode("Hello"); // "SGVsbG8="
Base64.decode("SGVsbG8="); // "Hello"

Implements:

  • StringBuffer for efficient string concatenation.
  • Utf8EncodeEnumerator and Base64DecodeEnumerator for byte-level processing.

jsLabel2PDF.js

πŸ”– HTML-to-PDF label generator using a custom JavaScript PDF stream writer and Base64 embedding .

  • $.CreateTemplate(units, paperWidth, paperHeight, ...): Set up page and label dimensions.
  • $.CreateLabel(): Prepare a new label.
  • $.AddText(x, y, str, fontSize): Queue text at coordinates.
  • $.DrawPDF(): Assemble PDF objects and prompt download as Data URI.
$.CreateTemplate("inches", 4, 6, 0, 0, 4, 6, 1, 6, 0.4, 0);
$.AddText(0.8, 0.8, "Test Labels", 12);
$.DrawPDF();

mediaplayer/license.txt

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 license for JW Player assets .


mediaplayer/readme.html

πŸ“‹ Quickstart guide for JW Player 5 embedding. Includes:

  1. Folder structure for jwplayer/.
  2. Example HTML embed snippet:
<div id="mediaplayer">JW Player goes here</div>
<script src="jwplayer.js"></script>
<script>
  jwplayer("mediaplayer").setup({
    flashplayer: "player.swf",
    file: "video.mp4",
    image: "preview.jpg"
  });
</script>