Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

ChangeLog

2.0 RC 3, 14 March 2017

Due the relatively small changes and additions, this version is NOT pushing the planned production release of 25 March 2017 ahead any.

  • Added "replace" type to _.nodeAdd and any associated functions that rely upon it such as _.make
  • Fixed bug in JSON.serialize polyfill. Pretty much a stupid typo.
  • Fixed bug in x.getXMLValuesByName -- another minor typo.
  • Optimized _.nodeAddSelectButton by removing some redundant logic.
  • Optimized _.make reduced code size by re-arranging order of trapping special functions/handling in attribute object.

2.0 RC 2, 4 March 2017

Was not originally planning on a RC2, but suggestions from the peanut gallery prompted the addition of some new features and one pretty big change in behavior.


  • Added Several new simple methods for determining scrolling information about a page. Specifically:

    1. _.scrollMaxX
    2. _.scrollMaxY
    3. _.scrollX
    4. _.scrollY
  • Added Some new String methods.

    1. String.pad
    2. String.strFrom
  • Fixed Bug where cross-browser auto-fix for internally prefixed object methods was missing from codebase. I thought things felt a bit lightweight. Required for:
  • Added Polyfills for performance.now, Window.requestAnimationFrame, and Window.cancelAnimationFrame. I used a varient of the ones Erik Möller put up over on "My Opera" a few years ago, that now seems to have gone AWOL since, well... "My Opera" went the way of the dodo. Mine differes in that I have an internal function in place to check and replace for browser prefixed versions already, I have a wee bit different a way of iterating arrays I know the contents of, I polyfill performance.now so that's used for the timer, I set 16.666667 instead of a flat 16 for the timer interval to be closer to the common 60fps, and I directly copy Window.clearTimeout to Window.cancelAnimationFrame as there is no legitimate reason to wrap that since, well duh, an instance of Window is an instance of Window. It should also start up way faster than his since it does not just blindly assign values to Window to then check.
  • Added eSmooth.js sub-library to site and downloadable distro.
  • Revised _.queryAll will now return an empty array on ALL matches. This makes it easier to use Array.forEach on it without YOU having to hard code a return check.

These changes push the move from "Release Candidate" to "Production" ahead to 25 March 2017.

2.0 RC 1, 25 Februrary 2017

  • Fixed Spelling error in _.throwRange
  • Fixed Array.of added directly instead of by Array.prototype.of
  • Fixed String.repeat FINALLY working as it should.
  • Fixed _.queryAll now returns array in ALL browsers. Had to brute force it since apparently IE8 does support Element.querySelectorAll, but does NOT support Array.prototype.slice.call on a NodeList. DERP... no, seriously, what the hell? TEMPTED to polyfill Array.prototype.slice but is it worth the code for such a minor corner case?
  • Fixed bug in _.make that was broken by fix to application of 'type' attribute.
    This resulted in:
  • Refactored Internal eAddAttr function folded into _.make and greatly simplified. Originally had it recursive for support of objects inside objects, but data- attributes may have objects passed to them. The only object that "needs" to be parse is Element.style so I just special cased that one. Switched 'type' to a special case as well and reorganized the parsing order. New routine tested at five to fifteen percent faster depending on browser, seems more reliable, and is less code to boot!
  • Changed normalized some of the polyfills to be more consistent with the specification behaviors.

2.0 Beta 10, 24 Februrary 2017

  • Revised The three _.callbackArray methods have been moved to be extensions to Array instead. They are now:

    1. Array.callbackAnd
    2. Array.callbackAndAll
    3. Array.callbackOr
    This made more sense given what they do and how they do it. It also shaved a wee bit off the codebase size.
  • Fixed Documentation for _.scriptAdd outdated. Was still written as if the second parameter was the boolean async and not an object containing attributes to be added to the generated SCRIPT tag.
  • Fixed Bug in Array.callbackOr that would have prevented it from doing more than one true answer. DOH. Or should be inclusive like Array.callbackAndAll
  • Fixed Bugs in _.nodeCountAll and _.nodeCountChildren where parameters passed to _.nodeEachAll and _.nodeEachChild were reversed.
  • Bug Misspelt "Infinity" in _.throwRange
    Fixed 2.0 RC 1, 25 February 2017
  • Bug Array.of cannot be added via Prototype, must be direct.
    Fixed 2.0 RC 1, 25 February 2017
  • Bug CHRISTMAS ON A CRACKER!!! String.repeat STILL bugged!!
    Fixed 2.0 RC 1, 25 February 2017
  • Bug attr.style broken on _.make after fix for IE type="" attribute
    Fixed 2.0 RC 1, 25 February 2017
  • Issue _.queryAll on modern browsers returns a nodelist, but the legacy polyfill returns an Array. Question is, which is more useful? With the enhanced Array methods of ECMAScript 5/newer perhaps the Array would be the better choice?
    Resolved 2.0 RC1, 25 February 2017 -- forcing modern browsers to return Array

2.0 Beta 9, 23 February 2017

  • Fixed typos in _.nodeAddSelectButton
  • Fixed missing () in _.nodeSelect IE compatibility.
  • Refactored _.nodeSelect so that only the browser specific version needed is in fact used during runtime.
  • Fixed _.formSerialize handling of empty form elements.
  • Fixed _.formSerialize so it will use the text content of an OPTION tag as value if no value is specified, as per the HTML behavior of a form submit.
  • Bug Array.callbackOr Not iterating all results?!?
    Fixed 2.0 Beta 10, 24 February 2017
  • Bug _.nodeCountAll and _.nodeCountChildren parameters passed to _.nodeEachAll and _.nodeEachChild are reversed.
    Fixed 2.0 Beta 10, 24 February 2017

2.0 Beta 8, 21 February 2017

  • Fixed missing internal escFunc
  • Fixed Logic flow issue in String.repeat polyfill. Excellent example BTW of what pisses me off about C syntax and just how far away from how Assembly works every single language based on it is. ZERO way to check flags AFTER a shift operation, and no concept of a rotate... It's sad when certain tasks are actually simpler to code in machine language.
  • Bug typos preventing _.nodeAddSelectButton from working.
    Fixed 2.0 Beta 9, 23 February 2017
  • Bug _.nodeSelect not calling getRangeSelect as method.
    Fixed 2.0 Beta 9, 23 February 2017
  • Bug _.formSerialize passing empty form elements.
    Fixed 2.0 Beta 9, 23 February 2017
  • Bug When HTML encounters an OPTION tag that has no value, it will pass the content of that tag as the value server side during normal form handling. It appears that Element.value is NOT populated by any browser if the value is not explicitly stated, meaning that default behavior was not implemented in _.formSerialize.
    Fixed 2.0 Beta 9, 23 February 2017

2.0 Beta 7, 19 February 2017

  • Internal Using own minifier as most existing ones seem to choke on certain aspects of how Elementals works. Will have to test in detail this minifier just to be sure it's not screwing things up beyond repair. Customizeed specifically for elementals so most likely it would be highly inefficient for any other codebase.
  • Optimize Used shorter single letter parameters in codebase, but did so in a consistent manner. If you want to know the full name of the variable when browsing the code, refer to the corresponding reference page.
  • Website Added distro package to downloads containing the most recent versions of elementals.js, elementals.min.js, and the various live demos.
  • Website Added stats tracking to home page to keep track of the various sizes and bandwidth elementals.js uses depending on what version is used and how you serve it.
  • Fixed Stupid "bug" where _.log(msg, 'alert'); wouldn't function in some browsers because of how jacktarded JavaScript's use of scope is when using literal notation on an object. Thanks to Goos over on codingforums for pointing out that issue and the Array.reduce flaws that were fixed in beta 6.
  • To-Do Hey, where the blazes did the license agreement go?!? I can't even find the bloody file! Hoping it didn't go awol and I end up having to rewrite that from scratch, even if it is my stock "to blazes with open sores, if you're gonna give something away give it away" rant.
    Fixed interim site update
  • Bug Failed to port escFunc, so JSON polyfill broken in legacy IE.
    Fixed Beta 8, 21 February 2017
  • Bug String.repeat polyfill has nonsensical binary logic... no internal check of value shifted off the count.
    Fixed Beta 8, 21 February 2017

2.0 Beta 6, 18 February 2017

  • Fixed bug in Array.reduce and Array.reduceRight
  • Documented _.uSortRestore
  • Added more transparent handling of event callbacks, resulting in:
  • removed _.eventProcess as pointless redundancy.
  • To-Do Document changes to demo documentation due to removal of _.eventProcess
    Documented interim site update

2.0 Beta 5, 17 February 2017

  • Fixed bugs in _.uSortElement
  • Added _.uSortRestore function to return list to original window load state.
  • Modified large sections of the codebase. Some size optimizations, a good deal of speed optimizations such as making frequently called callbacks static instead of having them as anonymous functions.Even with the added functionality, the overall codesize has not grown significantly since Beta 4.
  • To-Do DOCUMENT _.uSortRestore and add functionality to the demos.
    Documented Beta 6, 18 February 2017
  • BUG Array.reduce and Array.reduceRight written for numeric processing only, should be able to handle strings.
    Fixed Beta 6, 18 February 2017

2.0 Beta 4, 17 February 2017

  • Fixed Legacy IE bug regarding direct assignment vs. Element.setAttribute. Created new internal objAttrSet function to handle correct passing of object parameters (such as style) to attributes whilst still passing 'nodePlacements' and 'content' type 'extraNodes'. Debating on if function should be exposed interface-side.
  • Website made changeLog its own page, it's big enough now!
  • Bug _.uSortElement utterly banjaxed.
    Fixed 2.0 Beta 5

2.0 Beta 3, 16 February 2017

  • Fixed bugs in onprogress handling and various other small quirks in the _.ajax handler.
  • Fixed bug in _.make that resulted in trying to set Element.onclick fail to function. Apparently you can't set an anonymous function using Element.setAttribute. I didn't know that!
  • Documented _.nodeData
  • Bug Legacy IE will not set unknown 'type' on input using direct assignment, must use setAttribute. IE will not set functions on Element without direct assignment! Gonna have to trap BOTH to use the correct method.
    Fixed 2.0 Beta 4.

2.0 Beta 2, 12 February 2017

  • Fixed numerous typo's
  • Fixed _.nodeNext was still written to old Element extension model from 1.0, making it non-functional. Odd that _.nodePrev was correct given they're pretty much the same thing.
  • Fixed _.classToggle wasn't returning boolean true or false, an essential part of its functionality.
  • Fixed _.nodeData function missing, copied from 1.0 and updated to work with new structure
  • Added _.NODEMASK_type constants.
  • To-do _.nodeData documentation.
    Documented in Beta 3

2.0 Beta 1, 10 February 2017

  • First public release after relaunch of project