Remove any console.log statements
This commit is contained in:
parent
1dad460368
commit
6829ad10f7
@ -5,7 +5,7 @@
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">//This is used so IE 8 can use the classList api</span><span class="WHIT">
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">//This is used so IE can use the classList api</span><span class="WHIT">
|
||||
<span class='line'> 2</span> </span><span class="COMM">/*
|
||||
<span class='line'> 3</span> * classList.js: Cross-browser full element.classList implementation.
|
||||
<span class='line'> 4</span> * 2011-06-15
|
||||
@ -213,9 +213,9 @@
|
||||
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="COMM">//Well, I guess that attribute doesn't exist</span><span class="WHIT">
|
||||
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">oldVal</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Element does not have the selected attribute"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="COMM">/*console.log(value);
|
||||
<span class='line'>210</span> console.log(sel);
|
||||
<span class='line'>211</span> console.log("Element does not have the selected attribute");*/</span><span class="WHIT">
|
||||
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>214</span>
|
||||
@ -301,247 +301,242 @@
|
||||
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">equi</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>297</span>
|
||||
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="COMM">//No matches? Well, lets log it for now</span><span class="WHIT">
|
||||
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Property "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" nor an equivalent seems to exist"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>300</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>301</span>
|
||||
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||
<span class='line'>303</span>
|
||||
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>305</span> * DOM
|
||||
<span class='line'>306</span> *
|
||||
<span class='line'>307</span> * Dom manipulation module
|
||||
<span class='line'>308</span> * @namespace
|
||||
<span class='line'>309</span> * @memberOf $_
|
||||
<span class='line'>310</span> * @name dom
|
||||
<span class='line'>311</span> */</span><span class="WHIT">
|
||||
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>314</span> * Adds a class to the element(s) specified by the current
|
||||
<span class='line'>315</span> * selector
|
||||
<span class='line'>316</span> *
|
||||
<span class='line'>317</span> * @name addClass
|
||||
<span class='line'>318</span> * @memberOf $_.dom
|
||||
<span class='line'>319</span> * @function
|
||||
<span class='line'>320</span> * @param string class
|
||||
<span class='line'>321</span> */</span><span class="WHIT">
|
||||
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">addClass</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.add</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>329</span> * Removes a class from the element(s) specified by the current
|
||||
<span class='line'>330</span> * selector
|
||||
<span class='line'>331</span> *
|
||||
<span class='line'>332</span> * @name removeClass
|
||||
<span class='line'>333</span> * @memberOf $_.dom
|
||||
<span class='line'>334</span> * @function
|
||||
<span class='line'>335</span> * @param string class
|
||||
<span class='line'>336</span> */</span><span class="WHIT">
|
||||
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="NAME">removeClass</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>339</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>340</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.remove</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>342</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>344</span> * Hides the element(s) specified by the current selector
|
||||
<span class='line'>345</span> *
|
||||
<span class='line'>346</span> * @name hide
|
||||
<span class='line'>347</span> * @memberOf $_.dom
|
||||
<span class='line'>348</span> * @function
|
||||
<span class='line'>349</span> */</span><span class="WHIT">
|
||||
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="NAME">hide</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>352</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">'display'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>354</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>355</span> * Shows the element(s) specified by the current selector.
|
||||
<span class='line'>356</span> * if type is specified, the element will have it's style
|
||||
<span class='line'>357</span> * property set to "display:[your type]". If type is not
|
||||
<span class='line'>358</span> * specified, the element is set to "display:block".
|
||||
<span class='line'>359</span> *
|
||||
<span class='line'>360</span> * @name show
|
||||
<span class='line'>361</span> * @memberOf $_.dom
|
||||
<span class='line'>362</span> * @function
|
||||
<span class='line'>363</span> * @param [string] type
|
||||
<span class='line'>364</span> */</span><span class="WHIT">
|
||||
<span class='line'>365</span> </span><span class="WHIT"> </span><span class="NAME">show</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>366</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>368</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"block"</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>371</span>
|
||||
<span class='line'>372</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">"display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>373</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>374</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>375</span> * Sets attributes on element(s) specified by the current
|
||||
<span class='line'>376</span> * selector, or, if name is not specified, returns the
|
||||
<span class='line'>377</span> * value of the attribute of the element specified by the
|
||||
<span class='line'>378</span> * current selector.
|
||||
<span class='line'>379</span> *
|
||||
<span class='line'>380</span> * @name attr
|
||||
<span class='line'>381</span> * @memberOf $_.dom
|
||||
<span class='line'>382</span> * @function
|
||||
<span class='line'>383</span> * @param string name
|
||||
<span class='line'>384</span> * @param [string] value
|
||||
<span class='line'>385</span> * @return string
|
||||
<span class='line'>386</span> * @type string
|
||||
<span class='line'>387</span> */</span><span class="WHIT">
|
||||
<span class='line'>388</span> </span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>391</span>
|
||||
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="COMM">//Make sure you don't try to get a bunch of elements</span><span class="WHIT">
|
||||
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Must be a singular element"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>398</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//You can set a bunch, though</span><span class="WHIT">
|
||||
<span class='line'>400</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>401</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>402</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>403</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>404</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>405</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="COMM">//Normal behavior</span><span class="WHIT">
|
||||
<span class='line'>406</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>407</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>408</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>409</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>410</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>411</span> * Sets or retrieves the text content of the element
|
||||
<span class='line'>412</span> * specified by the current selector. If a value is
|
||||
<span class='line'>413</span> * passed, it will set that value on the current element,
|
||||
<span class='line'>414</span> * otherwise it will return the value of the current element
|
||||
<span class='line'>415</span> *
|
||||
<span class='line'>416</span> * @name text
|
||||
<span class='line'>417</span> * @memberOf $_.dom
|
||||
<span class='line'>418</span> * @function
|
||||
<span class='line'>419</span> * @param [string] value
|
||||
<span class='line'>420</span> * @return string
|
||||
<span class='line'>421</span> * @type string
|
||||
<span class='line'>422</span> */</span><span class="WHIT">
|
||||
<span class='line'>423</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>424</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>425</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>426</span>
|
||||
<span class='line'>427</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>428</span>
|
||||
<span class='line'>429</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>430</span>
|
||||
<span class='line'>431</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.textContent</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>432</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"textContent"</span><span class="WHIT">
|
||||
<span class='line'>433</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.innerText</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>434</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"innerText"</span><span class="WHIT">
|
||||
<span class='line'>435</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"innerHTML"</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>436</span>
|
||||
<span class='line'>437</span> </span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>438</span>
|
||||
<span class='line'>439</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">set</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>298</span>
|
||||
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||
<span class='line'>300</span>
|
||||
<span class='line'>301</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>302</span> * DOM
|
||||
<span class='line'>303</span> *
|
||||
<span class='line'>304</span> * Dom manipulation module
|
||||
<span class='line'>305</span> * @namespace
|
||||
<span class='line'>306</span> * @memberOf $_
|
||||
<span class='line'>307</span> * @name dom
|
||||
<span class='line'>308</span> */</span><span class="WHIT">
|
||||
<span class='line'>309</span> </span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>311</span> * Adds a class to the element(s) specified by the current
|
||||
<span class='line'>312</span> * selector
|
||||
<span class='line'>313</span> *
|
||||
<span class='line'>314</span> * @name addClass
|
||||
<span class='line'>315</span> * @memberOf $_.dom
|
||||
<span class='line'>316</span> * @function
|
||||
<span class='line'>317</span> * @param string class
|
||||
<span class='line'>318</span> */</span><span class="WHIT">
|
||||
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="NAME">addClass</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.add</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>326</span> * Removes a class from the element(s) specified by the current
|
||||
<span class='line'>327</span> * selector
|
||||
<span class='line'>328</span> *
|
||||
<span class='line'>329</span> * @name removeClass
|
||||
<span class='line'>330</span> * @memberOf $_.dom
|
||||
<span class='line'>331</span> * @function
|
||||
<span class='line'>332</span> * @param string class
|
||||
<span class='line'>333</span> */</span><span class="WHIT">
|
||||
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="NAME">removeClass</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>335</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.remove</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>339</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>340</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>341</span> * Hides the element(s) specified by the current selector
|
||||
<span class='line'>342</span> *
|
||||
<span class='line'>343</span> * @name hide
|
||||
<span class='line'>344</span> * @memberOf $_.dom
|
||||
<span class='line'>345</span> * @function
|
||||
<span class='line'>346</span> */</span><span class="WHIT">
|
||||
<span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">hide</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">'display'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>352</span> * Shows the element(s) specified by the current selector.
|
||||
<span class='line'>353</span> * if type is specified, the element will have it's style
|
||||
<span class='line'>354</span> * property set to "display:[your type]". If type is not
|
||||
<span class='line'>355</span> * specified, the element is set to "display:block".
|
||||
<span class='line'>356</span> *
|
||||
<span class='line'>357</span> * @name show
|
||||
<span class='line'>358</span> * @memberOf $_.dom
|
||||
<span class='line'>359</span> * @function
|
||||
<span class='line'>360</span> * @param [string] type
|
||||
<span class='line'>361</span> */</span><span class="WHIT">
|
||||
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">show</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>364</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>365</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>366</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"block"</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>368</span>
|
||||
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">"display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>371</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>372</span> * Sets attributes on element(s) specified by the current
|
||||
<span class='line'>373</span> * selector, or, if name is not specified, returns the
|
||||
<span class='line'>374</span> * value of the attribute of the element specified by the
|
||||
<span class='line'>375</span> * current selector.
|
||||
<span class='line'>376</span> *
|
||||
<span class='line'>377</span> * @name attr
|
||||
<span class='line'>378</span> * @memberOf $_.dom
|
||||
<span class='line'>379</span> * @function
|
||||
<span class='line'>380</span> * @param string name
|
||||
<span class='line'>381</span> * @param [string] value
|
||||
<span class='line'>382</span> * @return string
|
||||
<span class='line'>383</span> * @type string
|
||||
<span class='line'>384</span> */</span><span class="WHIT">
|
||||
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>388</span>
|
||||
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="COMM">//Make sure you don't try to get a bunch of elements</span><span class="WHIT">
|
||||
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//You can set a bunch, though</span><span class="WHIT">
|
||||
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>398</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>400</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="COMM">//Normal behavior</span><span class="WHIT">
|
||||
<span class='line'>401</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>402</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>403</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>404</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>405</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>406</span> * Sets or retrieves the text content of the element
|
||||
<span class='line'>407</span> * specified by the current selector. If a value is
|
||||
<span class='line'>408</span> * passed, it will set that value on the current element,
|
||||
<span class='line'>409</span> * otherwise it will return the value of the current element
|
||||
<span class='line'>410</span> *
|
||||
<span class='line'>411</span> * @name text
|
||||
<span class='line'>412</span> * @memberOf $_.dom
|
||||
<span class='line'>413</span> * @function
|
||||
<span class='line'>414</span> * @param [string] value
|
||||
<span class='line'>415</span> * @return string
|
||||
<span class='line'>416</span> * @type string
|
||||
<span class='line'>417</span> */</span><span class="WHIT">
|
||||
<span class='line'>418</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>419</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>420</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>421</span>
|
||||
<span class='line'>422</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>423</span>
|
||||
<span class='line'>424</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>425</span>
|
||||
<span class='line'>426</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.textContent</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>427</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"textContent"</span><span class="WHIT">
|
||||
<span class='line'>428</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.innerText</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>429</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"innerText"</span><span class="WHIT">
|
||||
<span class='line'>430</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"innerHTML"</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>431</span>
|
||||
<span class='line'>432</span> </span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>433</span>
|
||||
<span class='line'>434</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">set</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>435</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>436</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>437</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>438</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>439</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>440</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>441</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>442</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>443</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>444</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>445</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>446</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>447</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>448</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>449</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>450</span> * Sets or retrieves a css property of the element
|
||||
<span class='line'>451</span> * specified by the current selector. If a value is
|
||||
<span class='line'>452</span> * passed, it will set that value on the current element,
|
||||
<span class='line'>453</span> * otherwise it will return the value of the css property
|
||||
<span class='line'>454</span> * on the current element
|
||||
<span class='line'>455</span> *
|
||||
<span class='line'>456</span> * @name css
|
||||
<span class='line'>457</span> * @memberOf $_.dom
|
||||
<span class='line'>458</span> * @function
|
||||
<span class='line'>459</span> * @param string property
|
||||
<span class='line'>460</span> * @param [string] value
|
||||
<span class='line'>461</span> * @return string
|
||||
<span class='line'>462</span> * @type string
|
||||
<span class='line'>463</span> */</span><span class="WHIT">
|
||||
<span class='line'>464</span> </span><span class="WHIT"> </span><span class="NAME">css</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>465</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>466</span> </span><span class="WHIT"> </span><span class="COMM">//Return the current value if a value is not set</span><span class="WHIT">
|
||||
<span class='line'>467</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>468</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>469</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">this.el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>470</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>471</span>
|
||||
<span class='line'>472</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>473</span> </span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>474</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>475</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>476</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>477</span> * Adds to the innerHTML of the current element, after the last child.
|
||||
<span class='line'>478</span> *
|
||||
<span class='line'>479</span> * @example $_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element
|
||||
<span class='line'>480</span> * @name append
|
||||
<span class='line'>481</span> * @memberOf $_.dom
|
||||
<span class='line'>482</span> * @function
|
||||
<span class='line'>483</span> * @param string htm
|
||||
<span class='line'>484</span> */</span><span class="WHIT">
|
||||
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="NAME">append</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>486</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>487</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">document.insertAdjacentHTML</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>488</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>489</span> </span><span class="WHIT"> </span><span class="NAME">this.el.insertAdjacentHTML</span><span class="PUNC">(</span><span class="STRN">'beforeend'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>491</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>492</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>493</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>494</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>495</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>496</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>497</span> * Adds to the innerHTML of the selected element, before the current children
|
||||
<span class='line'>498</span> *
|
||||
<span class='line'>499</span> * @name prepend
|
||||
<span class='line'>500</span> * @memberOf $_.dom
|
||||
<span class='line'>501</span> * @function
|
||||
<span class='line'>502</span> * @param string htm
|
||||
<span class='line'>503</span> */</span><span class="WHIT">
|
||||
<span class='line'>504</span> </span><span class="WHIT"> </span><span class="NAME">prepend</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>505</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">document.insertAdjacentHTML</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>507</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>508</span> </span><span class="WHIT"> </span><span class="NAME">this.el.insertAdjacentHTML</span><span class="PUNC">(</span><span class="STRN">'afterbegin'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>509</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>510</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>511</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>512</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>513</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>514</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>515</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>516</span> * Sets or gets the innerHTML propery of the element(s) passed
|
||||
<span class='line'>517</span> *
|
||||
<span class='line'>518</span> * @name html
|
||||
<span class='line'>519</span> * @memberOf $_.dom
|
||||
<span class='line'>520</span> * @function
|
||||
<span class='line'>521</span> * @param [string] htm
|
||||
<span class='line'>522</span> * @return string
|
||||
<span class='line'>523</span> * @type string
|
||||
<span class='line'>524</span> */</span><span class="WHIT">
|
||||
<span class='line'>525</span> </span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>526</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>441</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>442</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>443</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>444</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>445</span> * Sets or retrieves a css property of the element
|
||||
<span class='line'>446</span> * specified by the current selector. If a value is
|
||||
<span class='line'>447</span> * passed, it will set that value on the current element,
|
||||
<span class='line'>448</span> * otherwise it will return the value of the css property
|
||||
<span class='line'>449</span> * on the current element
|
||||
<span class='line'>450</span> *
|
||||
<span class='line'>451</span> * @name css
|
||||
<span class='line'>452</span> * @memberOf $_.dom
|
||||
<span class='line'>453</span> * @function
|
||||
<span class='line'>454</span> * @param string property
|
||||
<span class='line'>455</span> * @param [string] value
|
||||
<span class='line'>456</span> * @return string
|
||||
<span class='line'>457</span> * @type string
|
||||
<span class='line'>458</span> */</span><span class="WHIT">
|
||||
<span class='line'>459</span> </span><span class="WHIT"> </span><span class="NAME">css</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>460</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>461</span> </span><span class="WHIT"> </span><span class="COMM">//Return the current value if a value is not set</span><span class="WHIT">
|
||||
<span class='line'>462</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>463</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>464</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">this.el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>465</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>466</span>
|
||||
<span class='line'>467</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>468</span> </span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>469</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>470</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>471</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>472</span> * Adds to the innerHTML of the current element, after the last child.
|
||||
<span class='line'>473</span> *
|
||||
<span class='line'>474</span> * @example $_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element
|
||||
<span class='line'>475</span> * @name append
|
||||
<span class='line'>476</span> * @memberOf $_.dom
|
||||
<span class='line'>477</span> * @function
|
||||
<span class='line'>478</span> * @param string htm
|
||||
<span class='line'>479</span> */</span><span class="WHIT">
|
||||
<span class='line'>480</span> </span><span class="WHIT"> </span><span class="NAME">append</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>481</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>482</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">document.insertAdjacentHTML</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>483</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>484</span> </span><span class="WHIT"> </span><span class="NAME">this.el.insertAdjacentHTML</span><span class="PUNC">(</span><span class="STRN">'beforeend'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>486</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>487</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>488</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>489</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>491</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>492</span> * Adds to the innerHTML of the selected element, before the current children
|
||||
<span class='line'>493</span> *
|
||||
<span class='line'>494</span> * @name prepend
|
||||
<span class='line'>495</span> * @memberOf $_.dom
|
||||
<span class='line'>496</span> * @function
|
||||
<span class='line'>497</span> * @param string htm
|
||||
<span class='line'>498</span> */</span><span class="WHIT">
|
||||
<span class='line'>499</span> </span><span class="WHIT"> </span><span class="NAME">prepend</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>500</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>501</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">document.insertAdjacentHTML</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>502</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>503</span> </span><span class="WHIT"> </span><span class="NAME">this.el.insertAdjacentHTML</span><span class="PUNC">(</span><span class="STRN">'afterbegin'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>504</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>505</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>507</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>508</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>509</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>510</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>511</span> * Sets or gets the innerHTML propery of the element(s) passed
|
||||
<span class='line'>512</span> *
|
||||
<span class='line'>513</span> * @name html
|
||||
<span class='line'>514</span> * @memberOf $_.dom
|
||||
<span class='line'>515</span> * @function
|
||||
<span class='line'>516</span> * @param [string] htm
|
||||
<span class='line'>517</span> * @return string
|
||||
<span class='line'>518</span> * @type string
|
||||
<span class='line'>519</span> */</span><span class="WHIT">
|
||||
<span class='line'>520</span> </span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>521</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>522</span>
|
||||
<span class='line'>523</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>524</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>525</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>526</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>527</span>
|
||||
<span class='line'>528</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>529</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>530</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>531</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>528</span> </span><span class="WHIT"> </span><span class="COMM">//If the parameter is undefined, just return the current value</span><span class="WHIT">
|
||||
<span class='line'>529</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>530</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>531</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>532</span>
|
||||
<span class='line'>533</span> </span><span class="WHIT"> </span><span class="COMM">//If the parameter is undefined, just return the current value</span><span class="WHIT">
|
||||
<span class='line'>534</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>535</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>536</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>537</span>
|
||||
<span class='line'>538</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'dom'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>539</span>
|
||||
<span class='line'>540</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
||||
<span class='line'>533</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'dom'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>534</span>
|
||||
<span class='line'>535</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
@ -74,189 +74,183 @@
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">_listener</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_listener</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Failed to _attach event:"</span><span class="PUNC">+</span><span class="NAME">event</span><span class="PUNC">+</span><span class="STRN">" on "</span><span class="PUNC">+</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 76</span> * @private
|
||||
<span class='line'> 77</span> */</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.detachEvent</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expando</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">kis_expando</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expando</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">listeners.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC"><</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">sel.detachEvent</span><span class="PUNC">(</span><span class="STRN">"on"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">_listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">listeners.splice</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">listeners.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 72</span> * @private
|
||||
<span class='line'> 73</span> */</span><span class="WHIT">
|
||||
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.detachEvent</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expando</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">kis_expando</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expando</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">listeners.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC"><</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">sel.detachEvent</span><span class="PUNC">(</span><span class="STRN">"on"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">_listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">listeners.splice</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">listeners.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>101</span>
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span>
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>109</span>
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>116</span>
|
||||
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="COMM">// Multiple events? Run recursively!</span><span class="WHIT">
|
||||
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">event.match</span><span class="PUNC">(</span><span class="REGX">/^([\w\-]+)$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">event</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.split</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>121</span>
|
||||
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>123</span>
|
||||
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>128</span>
|
||||
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>110</span>
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="COMM">// Multiple events? Run recursively!</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">event.match</span><span class="PUNC">(</span><span class="REGX">/^([\w\-]+)$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">event</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.split</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span>
|
||||
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>117</span>
|
||||
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>122</span>
|
||||
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>125</span>
|
||||
<span class='line'>126</span>
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">add</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>131</span>
|
||||
<span class='line'>132</span>
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">add</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>142</span>
|
||||
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="COMM">// attach the listener to the parent object</span><span class="WHIT">
|
||||
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>147</span>
|
||||
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tar</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>136</span>
|
||||
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="COMM">// attach the listener to the parent object</span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>141</span>
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tar</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span>
|
||||
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="COMM">// IE 8 doesn't have event bound to element</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">window.event</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>146</span>
|
||||
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="COMM">// Get the live version of the target selector</span><span class="WHIT">
|
||||
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$_.$</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>149</span>
|
||||
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="COMM">// IE 8 doesn't have event bound to element</span><span class="WHIT">
|
||||
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">window.event</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>152</span>
|
||||
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="COMM">// Get the live version of the target selector</span><span class="WHIT">
|
||||
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$_.$</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="COMM">// Check each element to see if it matches the target</span><span class="WHIT">
|
||||
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="COMM">// IE 8 doesn't have target in the event object</span><span class="WHIT">
|
||||
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">tar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.target</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">e.srcElement</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>155</span>
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="COMM">// Check each element to see if it matches the target</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="COMM">// IE 8 doesn't have target in the event object</span><span class="WHIT">
|
||||
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="NAME">tar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.target</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">e.srcElement</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="COMM">// Fire target callback when event bubbles from target</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">tar</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="COMM">// Trigger the event callback</span><span class="WHIT">
|
||||
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>161</span>
|
||||
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="COMM">// Fire target callback when event bubbles from target</span><span class="WHIT">
|
||||
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">tar</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="COMM">// Trigger the event callback</span><span class="WHIT">
|
||||
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>167</span>
|
||||
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="COMM">// Stop event propegation</span><span class="WHIT">
|
||||
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>172</span>
|
||||
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>175</span>
|
||||
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||
<span class='line'>177</span>
|
||||
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>179</span> * Event Listener module
|
||||
<span class='line'>180</span> *
|
||||
<span class='line'>181</span> * @namespace
|
||||
<span class='line'>182</span> * @name event
|
||||
<span class='line'>183</span> * @memberOf $_
|
||||
<span class='line'>184</span> */</span><span class="WHIT">
|
||||
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>187</span> * Adds an event that returns a callback when triggered on the selected
|
||||
<span class='line'>188</span> * event and selector
|
||||
<span class='line'>189</span> *
|
||||
<span class='line'>190</span> * @memberOf $_.event
|
||||
<span class='line'>191</span> * @name add
|
||||
<span class='line'>192</span> * @function
|
||||
<span class='line'>193</span> * @example Eg. $_("#selector").event.add("click", do_something());
|
||||
<span class='line'>194</span> * @param string event
|
||||
<span class='line'>195</span> * @param function callback
|
||||
<span class='line'>196</span> */</span><span class="WHIT">
|
||||
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>204</span> * Removes an event bound the the specified selector, event type, and callback
|
||||
<span class='line'>205</span> *
|
||||
<span class='line'>206</span> * @memberOf $_.event
|
||||
<span class='line'>207</span> * @name remove
|
||||
<span class='line'>208</span> * @function
|
||||
<span class='line'>209</span> * @example Eg. $_("#selector").event.remove("click", do_something());
|
||||
<span class='line'>210</span> * @param string event
|
||||
<span class='line'>211</span> * @param string callback
|
||||
<span class='line'>212</span> */</span><span class="WHIT">
|
||||
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>220</span> * Binds a persistent event to the document
|
||||
<span class='line'>221</span> *
|
||||
<span class='line'>222</span> * @memberOf $_.event
|
||||
<span class='line'>223</span> * @name live
|
||||
<span class='line'>224</span> * @function
|
||||
<span class='line'>225</span> * @example Eg. $_.event.live(".button", "click", do_something());
|
||||
<span class='line'>226</span> * @param string target
|
||||
<span class='line'>227</span> * @param string event
|
||||
<span class='line'>228</span> * @param function callback
|
||||
<span class='line'>229</span> */</span><span class="WHIT">
|
||||
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">live</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">document.documentElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>235</span> * Binds an event to a parent object
|
||||
<span class='line'>236</span> *
|
||||
<span class='line'>237</span> * @memberOf $_.event
|
||||
<span class='line'>238</span> * @name delegate
|
||||
<span class='line'>239</span> * @function
|
||||
<span class='line'>240</span> * @example Eg. $_("#parent").delegate(".button", "click", do_something());
|
||||
<span class='line'>241</span> * @param string target
|
||||
<span class='line'>242</span> * @param string event_type
|
||||
<span class='line'>243</span> * @param function callback
|
||||
<span class='line'>244</span> */</span><span class="WHIT">
|
||||
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="NAME">delegate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>252</span>
|
||||
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'event'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>254</span>
|
||||
<span class='line'>255</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
||||
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="COMM">// Stop event propegation</span><span class="WHIT">
|
||||
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>166</span>
|
||||
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>169</span>
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||
<span class='line'>171</span>
|
||||
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>173</span> * Event Listener module
|
||||
<span class='line'>174</span> *
|
||||
<span class='line'>175</span> * @namespace
|
||||
<span class='line'>176</span> * @name event
|
||||
<span class='line'>177</span> * @memberOf $_
|
||||
<span class='line'>178</span> */</span><span class="WHIT">
|
||||
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>181</span> * Adds an event that returns a callback when triggered on the selected
|
||||
<span class='line'>182</span> * event and selector
|
||||
<span class='line'>183</span> *
|
||||
<span class='line'>184</span> * @memberOf $_.event
|
||||
<span class='line'>185</span> * @name add
|
||||
<span class='line'>186</span> * @function
|
||||
<span class='line'>187</span> * @example Eg. $_("#selector").event.add("click", do_something());
|
||||
<span class='line'>188</span> * @param string event
|
||||
<span class='line'>189</span> * @param function callback
|
||||
<span class='line'>190</span> */</span><span class="WHIT">
|
||||
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>198</span> * Removes an event bound the the specified selector, event type, and callback
|
||||
<span class='line'>199</span> *
|
||||
<span class='line'>200</span> * @memberOf $_.event
|
||||
<span class='line'>201</span> * @name remove
|
||||
<span class='line'>202</span> * @function
|
||||
<span class='line'>203</span> * @example Eg. $_("#selector").event.remove("click", do_something());
|
||||
<span class='line'>204</span> * @param string event
|
||||
<span class='line'>205</span> * @param string callback
|
||||
<span class='line'>206</span> */</span><span class="WHIT">
|
||||
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>214</span> * Binds a persistent event to the document
|
||||
<span class='line'>215</span> *
|
||||
<span class='line'>216</span> * @memberOf $_.event
|
||||
<span class='line'>217</span> * @name live
|
||||
<span class='line'>218</span> * @function
|
||||
<span class='line'>219</span> * @example Eg. $_.event.live(".button", "click", do_something());
|
||||
<span class='line'>220</span> * @param string target
|
||||
<span class='line'>221</span> * @param string event
|
||||
<span class='line'>222</span> * @param function callback
|
||||
<span class='line'>223</span> */</span><span class="WHIT">
|
||||
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="NAME">live</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">document.documentElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>229</span> * Binds an event to a parent object
|
||||
<span class='line'>230</span> *
|
||||
<span class='line'>231</span> * @memberOf $_.event
|
||||
<span class='line'>232</span> * @name delegate
|
||||
<span class='line'>233</span> * @function
|
||||
<span class='line'>234</span> * @example Eg. $_("#parent").delegate(".button", "click", do_something());
|
||||
<span class='line'>235</span> * @param string target
|
||||
<span class='line'>236</span> * @param string event_type
|
||||
<span class='line'>237</span> * @param function callback
|
||||
<span class='line'>238</span> */</span><span class="WHIT">
|
||||
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">delegate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>246</span>
|
||||
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'event'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>248</span>
|
||||
<span class='line'>249</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
31
kis-all.js
31
kis-all.js
@ -224,16 +224,6 @@
|
||||
* @file polyfill.js
|
||||
*/
|
||||
|
||||
// Console.log polyfill for IE 8 stupidity
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* String trim function polyfill
|
||||
*/
|
||||
@ -289,7 +279,7 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
//This is used so IE 8 can use the classList api
|
||||
//This is used so IE can use the classList api
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 2011-06-15
|
||||
@ -495,9 +485,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Well, I guess that attribute doesn't exist
|
||||
if (typeof oldVal === "undefined" && (typeof value === "undefined" || value === null))
|
||||
{
|
||||
console.log(value);
|
||||
/*console.log(value);
|
||||
console.log(sel);
|
||||
console.log("Element does not have the selected attribute");
|
||||
console.log("Element does not have the selected attribute");*/
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -583,9 +573,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
sel.style[equi[prop]] = val;
|
||||
return null;
|
||||
}
|
||||
|
||||
//No matches? Well, lets log it for now
|
||||
console.log("Property " + prop + " nor an equivalent seems to exist");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@ -681,9 +668,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Make sure you don't try to get a bunch of elements
|
||||
if (sel.length > 1 && typeof value === "undefined")
|
||||
{
|
||||
console.log(sel);
|
||||
console.log("Must be a singular element");
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
else if (sel.length > 1 && typeof value !== "undefined") //You can set a bunch, though
|
||||
{
|
||||
@ -1047,10 +1032,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
_listener: _listener
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
@ -1089,9 +1070,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
|
||||
if(typeof sel === "undefined")
|
||||
{
|
||||
console.log(arguments);
|
||||
console.log(event);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Multiple events? Run recursively!
|
||||
|
34
kis-lite-dom-min.js
vendored
34
kis-lite-dom-min.js
vendored
@ -1,17 +1,17 @@
|
||||
(function(){if("undefined"!==typeof document.querySelector){var e,g,f,b;e=function(a){b="undefined"===typeof a?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof a?g(a):a;e.prototype.el=b;var a=f(e),d;for(d in a)"object"===typeof a[d]&&(a[d].el=b);a.el=b;return a};g=function(a,d){var b;if("string"!=typeof a||"undefined"===typeof a)return a;b=null!=d&&1===d.nodeType?d:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);b=b.querySelectorAll(a);
|
||||
return 1===b.length?b[0]:b};f=function(a){var d;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);d=typeof a;if(!("object"!==d&&"function"!==d))return d=function(){},d.prototype=a,new d}};e.ext=function(a,d){d.el=b;e[a]=d};e.ext("each",function(a){if("undefined"!==typeof b.length&&b!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(b,a);else{var d=b.length;if(0!==d)for(var c,h=0;h<d;h++)c=b.item(h)?b.item(h):b[h],a.call(c,c)}else a.call(b,
|
||||
b)});e.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};e=window.$_=window.$_||e;e.$=g}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(e){return Object.prototype.toString.apply(e)==="[object Array]"});
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var e={_do:function(e,f,b,a,d){var c=new XMLHttpRequest;typeof b==="undefined"&&(b=function(){});d=d?"POST":"GET";e=e+(d==="GET"?"?"+this._serialize(f):"");c.open(d,e);c.onreadystatechange=function(){c.readyState===4&&(c.status===200?b.call(c.responseText,c.responseText):typeof a!=="undefined"&&a.call(c.status,c.status))};if(d==="POST"){c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");c.send(this._serialize(f))}else c.send(null)},
|
||||
_serialize:function(e){var f,b,a=[];for(f in e)if(e.hasOwnProperty(f)&&typeof e[f]!=="function"){b=e[f].toString();f=encodeURIComponent(f);b=encodeURIComponent(b);a.push(f+"="+b)}return a.join("&")}};$_.ext("get",function(g,f,b,a){e._do(g,f,b,a,false)});$_.ext("post",function(g,f,b,a){e._do(g,f,b,a,true)});$_.ext("sse",function(e,f){var b;if(typeof EventSource!=="undefined"){b=new EventSource(e);b.onmessage=function(a){f.call(a.data,a.data)}}})}})();
|
||||
(function(){var e,g,f,b;if(typeof document.addEventListener!=="undefined"){e=function(a,d,b){typeof a.addEventListener!=="undefined"&&a.addEventListener(d,b,false)};g=function(a,b,c){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,c,false)}}else if(typeof document.attachEvent!=="undefined"){e=function(a,b,c){function e(a){c.apply(a)}if(typeof a.attachEvent!=="undefined"){g(b,c);a.attachEvent("on"+b,e);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||
|
||||
[];a.listeners[b].push({callback:c,_listener:e})}else console.log("Failed to _attach event:"+b+" on "+a)};g=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var e=a.KIS_0_6_0;if(e&&e.listeners&&e.listeners[b])for(var f=e.listeners[b],g=f.length,i=0;i<g;i++)if(f[i].callback===c){a.detachEvent("on"+b,f[i]._listener);f.splice(i,1);f.length===0&&delete e.listeners[b];break}}}}f=function(a,b,c,h){var j,k;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))h===
|
||||
true?e(a,b,c):g(a,b,c);else{b=b.split(" ");k=b.length;for(j=0;j<k;j++)f(a,b[j],c,h)}};b=function(a,b,c,e){f(a,c,function(c){var f,i,g,c=c||window.event;i=$_.$(b,a);for(f in i){g=c.target||c.srcElement;if(g==i[f]){e.call(i[f],c);c.stopPropagation()}}},true)};$_.ext("event",{add:function(a,b){$_.each(function(c){f(c,a,b,true)})},remove:function(a,b){$_.each(function(c){f(c,a,b,false)})},live:function(a,d,c){b(document.documentElement,a,d,c)},delegate:function(a,d,c){$_.each(function(e){b(e,a,d,c)})}})})();
|
||||
"undefined"!==typeof document&&!("classList"in document.createElement("a"))&&function(e){var e=(e.HTMLElement||e.Element).prototype,g=Object,f=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},b=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},a=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},d=function(c,d){if(d==="")throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(d))throw new a("INVALID_CHARACTER_ERR",
|
||||
"String contains an invalid character");return b.call(c,d)},c=function(a){for(var b=f.call(a.className),b=b?b.split(/\s+/):[],c=0,d=b.length;c<d;c++)this.push(b[c]);this._updateClassName=function(){a.className=this.toString()}},h=c.prototype=[],j=function(){return new c(this)};a.prototype=Error.prototype;h.item=function(a){return this[a]||null};h.contains=function(a){return d(this,a+"")!==-1};h.add=function(a){a=a+"";if(d(this,a)===-1){this.push(a);this._updateClassName()}};h.remove=function(a){a=
|
||||
d(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};h.toggle=function(a){a=a+"";d(this,a)===-1?this.add(a):this.remove(a)};h.toString=function(){return this.join(" ")};if(g.defineProperty){h={get:j,enumerable:true,configurable:true};try{g.defineProperty(e,"classList",h)}catch(k){if(k.number===-2146823252){h.enumerable=false;g.defineProperty(e,"classList",h)}}}else g.prototype.__defineGetter__&&e.__defineGetter__("classList",j)}(self);
|
||||
(function(){function e(b,a,d){var c,e;if(typeof b.hasAttribute!=="undefined"){b.hasAttribute(a)&&(c=b.getAttribute(a));e=true}else if(typeof b[a]!=="undefined"){c=b[a];e=false}else if(a==="class"&&typeof b.className!=="undefined"){a="className";c=b.className;e=false}if(typeof c==="undefined"&&(typeof d==="undefined"||d===null)){console.log(d);console.log(b);console.log("Element does not have the selected attribute");return null}if(typeof d==="undefined")return c;typeof d!=="undefined"&&d!==null?e===
|
||||
true?b.setAttribute(a,d):b[a]=d:d===null&&(e===true?b.removeAttribute(a):delete b[a]);return typeof d!=="undefined"?d:c}function g(b){return b.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function f(b,a,d){var c,a=g(a);c={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof d==="undefined"&&b.style[a]!=="undefined")return b.style[a];if(typeof d==="undefined"&&b.style[c[a]]!=="undefined")return b.style[c[a]];if(typeof b.style[a]!=="undefined"){b.style[a]=
|
||||
d;return null}if(b.style[c[a]]){b.style[c[a]]=d;return null}console.log("Property "+a+" nor an equivalent seems to exist")}$_.ext("dom",{addClass:function(b){$_.each(function(a){a.classList.add(b)})},removeClass:function(b){$_.each(function(a){a.classList.remove(b)})},hide:function(){this.css("display","none")},show:function(b){typeof b==="undefined"&&(b="block");this.css("display",b)},attr:function(b,a){var d=this.el;if(d.length>1&&typeof a==="undefined"){console.log(d);console.log("Must be a singular element")}else if(d.length>
|
||||
1&&typeof a!=="undefined")$_.each(function(c){return e(c,b,a)});else return e(d,b,a)},text:function(b){var a,d,c;c=this.el;d=typeof c.textContent!=="undefined"?"textContent":typeof c.innerText!=="undefined"?"innerText":"innerHTML";a=c[d];if(typeof b!=="undefined")return c[d]=b;return a},css:function(b,a){if(typeof a==="undefined")return f(this.el,b);$_.each(function(d){f(d,b,a)})},append:function(b){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",b):this.el.innerHTML=
|
||||
this.el.innerHTML+b},prepend:function(b){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",b):this.el.innerHTML=b+this.el.innerHTML},html:function(b){if(typeof b!=="undefined")this.el.innerHTML=b;return this.el.innerHTML}})})();
|
||||
(function(){if("undefined"!==typeof document.querySelector){var c,g,e,a;c=function(b){a="undefined"===typeof b?"undefined"!==typeof c.el?c.el:document.documentElement:"object"!==typeof b?g(b):b;c.prototype.el=a;var b=e(c),f;for(f in b)"object"===typeof b[f]&&(b[f].el=a);b.el=a;return b};g=function(b,f){var a;if("string"!=typeof b||"undefined"===typeof b)return b;a=null!=f&&1===f.nodeType?f:document;if(b.match(/^#([\w\-]+$)/))return document.getElementById(b.split("#")[1]);a=a.querySelectorAll(b);
|
||||
return 1===a.length?a[0]:a};e=function(b){var a;if("undefined"!==typeof b){if("undefined"!==typeof Object.create)return Object.create(b);a=typeof b;if(!("object"!==a&&"function"!==a))return a=function(){},a.prototype=b,new a}};c.ext=function(b,f){f.el=a;c[b]=f};c.ext("each",function(b){if("undefined"!==typeof a.length&&a!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(a,b);else{var f=a.length;if(0!==f)for(var d,h=0;h<f;h++)d=a.item(h)?a.item(h):a[h],b.call(d,d)}else b.call(a,
|
||||
a)});c.type=function(b){return function(){return b&&b!==this}.call(b)?(typeof b).toLowerCase():{}.toString.call(b).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};c=window.$_=window.$_||c;c.$=g}})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(c){return Object.prototype.toString.apply(c)==="[object Array]"});
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var c={_do:function(c,e,a,b,f){var d=new XMLHttpRequest;typeof a==="undefined"&&(a=function(){});f=f?"POST":"GET";c=c+(f==="GET"?"?"+this._serialize(e):"");d.open(f,c);d.onreadystatechange=function(){d.readyState===4&&(d.status===200?a.call(d.responseText,d.responseText):typeof b!=="undefined"&&b.call(d.status,d.status))};if(f==="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(this._serialize(e))}else d.send(null)},
|
||||
_serialize:function(c){var e,a,b=[];for(e in c)if(c.hasOwnProperty(e)&&typeof c[e]!=="function"){a=c[e].toString();e=encodeURIComponent(e);a=encodeURIComponent(a);b.push(e+"="+a)}return b.join("&")}};$_.ext("get",function(g,e,a,b){c._do(g,e,a,b,false)});$_.ext("post",function(g,e,a,b){c._do(g,e,a,b,true)});$_.ext("sse",function(c,e){var a;if(typeof EventSource!=="undefined"){a=new EventSource(c);a.onmessage=function(b){e.call(b.data,b.data)}}})}})();
|
||||
(function(){var c,g,e,a;if(typeof document.addEventListener!=="undefined"){c=function(b,a,d){typeof b.addEventListener!=="undefined"&&b.addEventListener(a,d,false)};g=function(b,a,d){typeof b.removeEventListener!=="undefined"&&b.removeEventListener(a,d,false)}}else if(typeof document.attachEvent!=="undefined"){c=function(b,a,d){function c(b){d.apply(b)}if(typeof b.attachEvent!=="undefined"){g(a,d);b.attachEvent("on"+a,c);b=b.KIS_0_6_0=b.KIS_0_6_0||{};b.listeners=b.listeners||{};b.listeners[a]=b.listeners[a]||
|
||||
[];b.listeners[a].push({callback:d,_listener:c})}};g=function(b,a,d){if(typeof b.detachEvent!=="undefined"){var c=b.KIS_0_6_0;if(c&&c.listeners&&c.listeners[a])for(var e=c.listeners[a],g=e.length,i=0;i<g;i++)if(e[i].callback===d){b.detachEvent("on"+a,e[i]._listener);e.splice(i,1);e.length===0&&delete c.listeners[a];break}}}}e=function(b,a,d,h){var j,k;if(typeof b==="undefined")return null;if(a.match(/^([\w\-]+)$/))h===true?c(b,a,d):g(b,a,d);else{a=a.split(" ");k=a.length;for(j=0;j<k;j++)e(b,a[j],
|
||||
d,h)}};a=function(b,a,d,c){e(b,d,function(d){var e,i,g,d=d||window.event;i=$_.$(a,b);for(e in i){g=d.target||d.srcElement;if(g==i[e]){c.call(i[e],d);d.stopPropagation()}}},true)};$_.ext("event",{add:function(b,a){$_.each(function(d){e(d,b,a,true)})},remove:function(b,a){$_.each(function(d){e(d,b,a,false)})},live:function(b,f,d){a(document.documentElement,b,f,d)},delegate:function(b,f,d){$_.each(function(c){a(c,b,f,d)})}})})();
|
||||
"undefined"!==typeof document&&!("classList"in document.createElement("a"))&&function(c){var c=(c.HTMLElement||c.Element).prototype,g=Object,e=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array.prototype.indexOf||function(b){for(var a=0,d=this.length;a<d;a++)if(a in this&&this[a]===b)return a;return-1},b=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},f=function(d,c){if(c==="")throw new b("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(c))throw new b("INVALID_CHARACTER_ERR",
|
||||
"String contains an invalid character");return a.call(d,c)},d=function(a){for(var b=e.call(a.className),b=b?b.split(/\s+/):[],d=0,c=b.length;d<c;d++)this.push(b[d]);this._updateClassName=function(){a.className=this.toString()}},h=d.prototype=[],j=function(){return new d(this)};b.prototype=Error.prototype;h.item=function(a){return this[a]||null};h.contains=function(a){return f(this,a+"")!==-1};h.add=function(a){a=a+"";if(f(this,a)===-1){this.push(a);this._updateClassName()}};h.remove=function(a){a=
|
||||
f(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};h.toggle=function(a){a=a+"";f(this,a)===-1?this.add(a):this.remove(a)};h.toString=function(){return this.join(" ")};if(g.defineProperty){h={get:j,enumerable:true,configurable:true};try{g.defineProperty(c,"classList",h)}catch(k){if(k.number===-2146823252){h.enumerable=false;g.defineProperty(c,"classList",h)}}}else g.prototype.__defineGetter__&&c.__defineGetter__("classList",j)}(self);
|
||||
(function(){function c(a,b,c){var d,e;if(typeof a.hasAttribute!=="undefined"){a.hasAttribute(b)&&(d=a.getAttribute(b));e=true}else if(typeof a[b]!=="undefined"){d=a[b];e=false}else if(b==="class"&&typeof a.className!=="undefined"){b="className";d=a.className;e=false}if(typeof d==="undefined"&&(typeof c==="undefined"||c===null))return null;if(typeof c==="undefined")return d;typeof c!=="undefined"&&c!==null?e===true?a.setAttribute(b,c):a[b]=c:c===null&&(e===true?a.removeAttribute(b):delete a[b]);return typeof c!==
|
||||
"undefined"?c:d}function g(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function e(a,b,c){var d,b=g(b);d={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&a.style[b]!=="undefined")return a.style[b];if(typeof c==="undefined"&&a.style[d[b]]!=="undefined")return a.style[d[b]];if(typeof a.style[b]!=="undefined"){a.style[b]=c;return null}if(a.style[d[b]]){a.style[d[b]]=c;return null}}$_.ext("dom",{addClass:function(a){$_.each(function(b){b.classList.add(a)})},
|
||||
removeClass:function(a){$_.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var e=this.el;if(e.length>1&&typeof b==="undefined")return null;if(e.length>1&&typeof b!=="undefined")$_.each(function(d){return c(d,a,b)});else return c(e,a,b)},text:function(a){var b,c,d;d=this.el;c=typeof d.textContent!=="undefined"?"textContent":typeof d.innerText!=="undefined"?"innerText":
|
||||
"innerHTML";b=d[c];if(typeof a!=="undefined")return d[c]=a;return b},css:function(a,b){if(typeof b==="undefined")return e(this.el,a);$_.each(function(c){e(c,a,b)})},append:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",a):this.el.innerHTML=this.el.innerHTML+a},prepend:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",a):this.el.innerHTML=a+this.el.innerHTML},html:function(a){if(typeof a!=="undefined")this.el.innerHTML=
|
||||
a;return this.el.innerHTML}})})();
|
||||
|
@ -224,16 +224,6 @@
|
||||
* @file polyfill.js
|
||||
*/
|
||||
|
||||
// Console.log polyfill for IE 8 stupidity
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* String trim function polyfill
|
||||
*/
|
||||
@ -502,10 +492,6 @@ if (typeof Array.isArray === "undefined")
|
||||
_listener: _listener
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
@ -544,9 +530,7 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
if(typeof sel === "undefined")
|
||||
{
|
||||
console.log(arguments);
|
||||
console.log(event);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Multiple events? Run recursively!
|
||||
@ -691,7 +675,7 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
//This is used so IE 8 can use the classList api
|
||||
//This is used so IE can use the classList api
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 2011-06-15
|
||||
@ -899,9 +883,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Well, I guess that attribute doesn't exist
|
||||
if (typeof oldVal === "undefined" && (typeof value === "undefined" || value === null))
|
||||
{
|
||||
console.log(value);
|
||||
/*console.log(value);
|
||||
console.log(sel);
|
||||
console.log("Element does not have the selected attribute");
|
||||
console.log("Element does not have the selected attribute");*/
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -987,9 +971,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
sel.style[equi[prop]] = val;
|
||||
return null;
|
||||
}
|
||||
|
||||
//No matches? Well, lets log it for now
|
||||
console.log("Property " + prop + " nor an equivalent seems to exist");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@ -1085,9 +1066,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Make sure you don't try to get a bunch of elements
|
||||
if (sel.length > 1 && typeof value === "undefined")
|
||||
{
|
||||
console.log(sel);
|
||||
console.log("Must be a singular element");
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
else if (sel.length > 1 && typeof value !== "undefined") //You can set a bunch, though
|
||||
{
|
||||
|
16
kis-lite-min.js
vendored
16
kis-lite-min.js
vendored
@ -1,9 +1,9 @@
|
||||
(function(){if("undefined"!==typeof document.querySelector){var f,g,d,c;f=function(a){c="undefined"===typeof a?"undefined"!==typeof f.el?f.el:document.documentElement:"object"!==typeof a?g(a):a;f.prototype.el=c;var a=d(f),b;for(b in a)"object"===typeof a[b]&&(a[b].el=c);a.el=c;return a};g=function(a,b){var e;if("string"!=typeof a||"undefined"===typeof a)return a;e=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);e=e.querySelectorAll(a);
|
||||
return 1===e.length?e[0]:e};d=function(a){var b;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);b=typeof a;if(!("object"!==b&&"function"!==b))return b=function(){},b.prototype=a,new b}};f.ext=function(a,b){b.el=c;f[a]=b};f.ext("each",function(a){if("undefined"!==typeof c.length&&c!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(c,a);else{var b=c.length;if(0!==b)for(var e,d=0;d<b;d++)e=c.item(d)?c.item(d):c[d],a.call(e,e)}else a.call(c,
|
||||
c)});f.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};f=window.$_=window.$_||f;f.$=g}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
(function(){if("undefined"!==typeof document.querySelector){var f,g,d,b;f=function(a){b="undefined"===typeof a?"undefined"!==typeof f.el?f.el:document.documentElement:"object"!==typeof a?g(a):a;f.prototype.el=b;var a=d(f),c;for(c in a)"object"===typeof a[c]&&(a[c].el=b);a.el=b;return a};g=function(a,c){var e;if("string"!=typeof a||"undefined"===typeof a)return a;e=null!=c&&1===c.nodeType?c:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);e=e.querySelectorAll(a);
|
||||
return 1===e.length?e[0]:e};d=function(a){var c;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);c=typeof a;if(!("object"!==c&&"function"!==c))return c=function(){},c.prototype=a,new c}};f.ext=function(a,c){c.el=b;f[a]=c};f.ext("each",function(a){if("undefined"!==typeof b.length&&b!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(b,a);else{var c=b.length;if(0!==c)for(var e,d=0;d<c;d++)e=b.item(d)?b.item(d):b[d],a.call(e,e)}else a.call(b,
|
||||
b)});f.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};f=window.$_=window.$_||f;f.$=g}})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(f){return Object.prototype.toString.apply(f)==="[object Array]"});
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var f={_do:function(g,d,c,a,b){var e=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});b=b?"POST":"GET";g=g+(b==="GET"?"?"+this._serialize(d):"");e.open(b,g);e.onreadystatechange=function(){e.readyState===4&&(e.status===200?c.call(e.responseText,e.responseText):typeof a!=="undefined"&&a.call(e.status,e.status))};if(b==="POST"){e.setRequestHeader("Content-Type","application/x-www-form-urlencoded");e.send(this._serialize(d))}else e.send(null)},
|
||||
_serialize:function(g){var d,c,a=[];for(d in g)if(g.hasOwnProperty(d)&&typeof g[d]!=="function"){c=g[d].toString();d=encodeURIComponent(d);c=encodeURIComponent(c);a.push(d+"="+c)}return a.join("&")}};$_.ext("get",function(g,d,c,a){f._do(g,d,c,a,false)});$_.ext("post",function(g,d,c,a){f._do(g,d,c,a,true)});$_.ext("sse",function(g,d){var c;if(typeof EventSource!=="undefined"){c=new EventSource(g);c.onmessage=function(a){d.call(a.data,a.data)}}})}})();
|
||||
(function(){var f,g,d,c;if(typeof document.addEventListener!=="undefined"){f=function(a,b,e){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,e,false)};g=function(a,b,e){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,e,false)}}else if(typeof document.attachEvent!=="undefined"){f=function(a,b,e){function c(a){e.apply(a)}if(typeof a.attachEvent!=="undefined"){g(b,e);a.attachEvent("on"+b,c);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||
|
||||
[];a.listeners[b].push({callback:e,_listener:c})}else console.log("Failed to _attach event:"+b+" on "+a)};g=function(a,b,e){if(typeof a.detachEvent!=="undefined"){var c=a.KIS_0_6_0;if(c&&c.listeners&&c.listeners[b])for(var d=c.listeners[b],g=d.length,f=0;f<g;f++)if(d[f].callback===e){a.detachEvent("on"+b,d[f]._listener);d.splice(f,1);d.length===0&&delete c.listeners[b];break}}}}d=function(a,b,e,c){var h,i;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))c===
|
||||
true?f(a,b,e):g(a,b,e);else{b=b.split(" ");i=b.length;for(h=0;h<i;h++)d(a,b[h],e,c)}};c=function(a,b,c,f){d(a,c,function(c){var e,d,g,c=c||window.event;d=$_.$(b,a);for(e in d){g=c.target||c.srcElement;if(g==d[e]){f.call(d[e],c);c.stopPropagation()}}},true)};$_.ext("event",{add:function(a,b){$_.each(function(c){d(c,a,b,true)})},remove:function(a,b){$_.each(function(c){d(c,a,b,false)})},live:function(a,b,e){c(document.documentElement,a,b,e)},delegate:function(a,b,e){$_.each(function(d){c(d,a,b,e)})}})})();
|
||||
(function(){if(typeof window.XMLHttpRequest!=="undefined"){var f={_do:function(g,d,b,a,c){var e=new XMLHttpRequest;typeof b==="undefined"&&(b=function(){});c=c?"POST":"GET";g=g+(c==="GET"?"?"+this._serialize(d):"");e.open(c,g);e.onreadystatechange=function(){e.readyState===4&&(e.status===200?b.call(e.responseText,e.responseText):typeof a!=="undefined"&&a.call(e.status,e.status))};if(c==="POST"){e.setRequestHeader("Content-Type","application/x-www-form-urlencoded");e.send(this._serialize(d))}else e.send(null)},
|
||||
_serialize:function(g){var d,b,a=[];for(d in g)if(g.hasOwnProperty(d)&&typeof g[d]!=="function"){b=g[d].toString();d=encodeURIComponent(d);b=encodeURIComponent(b);a.push(d+"="+b)}return a.join("&")}};$_.ext("get",function(g,d,b,a){f._do(g,d,b,a,false)});$_.ext("post",function(g,d,b,a){f._do(g,d,b,a,true)});$_.ext("sse",function(g,d){var b;if(typeof EventSource!=="undefined"){b=new EventSource(g);b.onmessage=function(a){d.call(a.data,a.data)}}})}})();
|
||||
(function(){var f,g,d,b;if(typeof document.addEventListener!=="undefined"){f=function(a,c,e){typeof a.addEventListener!=="undefined"&&a.addEventListener(c,e,false)};g=function(a,c,e){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(c,e,false)}}else if(typeof document.attachEvent!=="undefined"){f=function(a,c,e){function b(a){e.apply(a)}if(typeof a.attachEvent!=="undefined"){g(c,e);a.attachEvent("on"+c,b);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[c]=a.listeners[c]||
|
||||
[];a.listeners[c].push({callback:e,_listener:b})}};g=function(a,c,e){if(typeof a.detachEvent!=="undefined"){var b=a.KIS_0_6_0;if(b&&b.listeners&&b.listeners[c])for(var d=b.listeners[c],g=d.length,f=0;f<g;f++)if(d[f].callback===e){a.detachEvent("on"+c,d[f]._listener);d.splice(f,1);d.length===0&&delete b.listeners[c];break}}}}d=function(a,c,e,b){var h,i;if(typeof a==="undefined")return null;if(c.match(/^([\w\-]+)$/))b===true?f(a,c,e):g(a,c,e);else{c=c.split(" ");i=c.length;for(h=0;h<i;h++)d(a,c[h],
|
||||
e,b)}};b=function(a,c,b,f){d(a,b,function(b){var e,d,g,b=b||window.event;d=$_.$(c,a);for(e in d){g=b.target||b.srcElement;if(g==d[e]){f.call(d[e],b);b.stopPropagation()}}},true)};$_.ext("event",{add:function(a,c){$_.each(function(b){d(b,a,c,true)})},remove:function(a,c){$_.each(function(b){d(b,a,c,false)})},live:function(a,c,e){b(document.documentElement,a,c,e)},delegate:function(a,c,e){$_.each(function(d){b(d,a,c,e)})}})})();
|
||||
|
18
kis-lite.js
18
kis-lite.js
@ -224,16 +224,6 @@
|
||||
* @file polyfill.js
|
||||
*/
|
||||
|
||||
// Console.log polyfill for IE 8 stupidity
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* String trim function polyfill
|
||||
*/
|
||||
@ -502,10 +492,6 @@ if (typeof Array.isArray === "undefined")
|
||||
_listener: _listener
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
@ -544,9 +530,7 @@ if (typeof Array.isArray === "undefined")
|
||||
|
||||
if(typeof sel === "undefined")
|
||||
{
|
||||
console.log(arguments);
|
||||
console.log(event);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Multiple events? Run recursively!
|
||||
|
35
kis-min.js
vendored
35
kis-min.js
vendored
@ -1,21 +1,20 @@
|
||||
(function(){if("undefined"!==typeof document.querySelector){var d,o,p,e;d=function(g){e="undefined"===typeof g?"undefined"!==typeof d.el?d.el:document.documentElement:"object"!==typeof g?o(g):g;d.prototype.el=e;var g=p(d),i;for(i in g)"object"===typeof g[i]&&(g[i].el=e);g.el=e;return g};o=function(g,d){var e;if("string"!=typeof g||"undefined"===typeof g)return g;e=null!=d&&1===d.nodeType?d:document;if(g.match(/^#([\w\-]+$)/))return document.getElementById(g.split("#")[1]);e=e.querySelectorAll(g);
|
||||
return 1===e.length?e[0]:e};p=function(d){var e;if("undefined"!==typeof d){if("undefined"!==typeof Object.create)return Object.create(d);e=typeof d;if(!("object"!==e&&"function"!==e))return e=function(){},e.prototype=d,new e}};d.ext=function(g,i){i.el=e;d[g]=i};d.ext("each",function(d){if("undefined"!==typeof e.length&&e!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(e,d);else{var i=e.length;if(0!==i)for(var l,k=0;k<i;k++)l=e.item(k)?e.item(k):e[k],d.call(l,l)}else d.call(e,
|
||||
e)});d.type=function(d){return function(){return d&&d!==this}.call(d)?(typeof d).toLowerCase():{}.toString.call(d).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};d=window.$_=window.$_||d;d.$=o}})();"undefined"===typeof window.console&&(window.console={log:function(){}});"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
e)});d.type=function(d){return function(){return d&&d!==this}.call(d)?(typeof d).toLowerCase():{}.toString.call(d).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};d=window.$_=window.$_||d;d.$=o}})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
|
||||
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=false},Event.prototype.stopPropagation=function(){window.event.cancelBubble=true});"undefined"===typeof Array.isArray&&(Array.isArray=function(d){return Object.prototype.toString.apply(d)==="[object Array]"});
|
||||
(function(d){function o(a,b,c){var f,j;if(typeof a.hasAttribute!=="undefined"){a.hasAttribute(b)&&(f=a.getAttribute(b));j=true}else if(typeof a[b]!=="undefined"){f=a[b];j=false}else if(b==="class"&&typeof a.className!=="undefined"){b="className";f=a.className;j=false}if(typeof f==="undefined"&&(typeof c==="undefined"||c===null)){console.log(c);console.log(a);console.log("Element does not have the selected attribute");return null}if(typeof c==="undefined")return f;typeof c!=="undefined"&&c!==null?
|
||||
j===true?a.setAttribute(b,c):a[b]=c:c===null&&(j===true?a.removeAttribute(b):delete a[b]);return typeof c!=="undefined"?c:f}function p(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function e(a,b,c){var f,b=p(b);f={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&a.style[b]!=="undefined")return a.style[b];if(typeof c==="undefined"&&a.style[f[b]]!=="undefined")return a.style[f[b]];if(typeof a.style[b]!=="undefined"){a.style[b]=
|
||||
c;return null}if(a.style[f[b]]){a.style[f[b]]=c;return null}console.log("Property "+b+" nor an equivalent seems to exist")}typeof document!=="undefined"&&!("classList"in document.createElement("a"))&&function(a){var a=(a.HTMLElement||a.Element).prototype,b=Object,c=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},f=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},j=function(a,b){this.name=a;this.code=DOMException[a];
|
||||
this.message=b},d=function(a,b){if(b==="")throw new j("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new j("INVALID_CHARACTER_ERR","String contains an invalid character");return f.call(a,b)},h=function(a){for(var b=c.call(a.className),b=b?b.split(/\s+/):[],f=0,j=b.length;f<j;f++)this.push(b[f]);this._updateClassName=function(){a.className=this.toString()}},e=h.prototype=[],g=function(){return new h(this)};j.prototype=Error.prototype;e.item=function(a){return this[a]||
|
||||
null};e.contains=function(a){return d(this,a+"")!==-1};e.add=function(a){a=a+"";if(d(this,a)===-1){this.push(a);this._updateClassName()}};e.remove=function(a){a=d(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};e.toggle=function(a){a=a+"";d(this,a)===-1?this.add(a):this.remove(a)};e.toString=function(){return this.join(" ")};if(b.defineProperty){e={get:g,enumerable:true,configurable:true};try{b.defineProperty(a,"classList",e)}catch(i){if(i.number===-2146823252){e.enumerable=false;
|
||||
b.defineProperty(a,"classList",e)}}}else b.prototype.__defineGetter__&&a.__defineGetter__("classList",g)}(self);d.ext("dom",{addClass:function(a){d.each(function(b){b.classList.add(a)})},removeClass:function(a){d.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var c=this.el;if(c.length>1&&typeof b==="undefined"){console.log(c);console.log("Must be a singular element")}else if(c.length>
|
||||
1&&typeof b!=="undefined")d.each(function(c){return o(c,a,b)});else return o(c,a,b)},text:function(a){var b,c,f;f=this.el;c=typeof f.textContent!=="undefined"?"textContent":typeof f.innerText!=="undefined"?"innerText":"innerHTML";b=f[c];if(typeof a!=="undefined")return f[c]=a;return b},css:function(a,b){if(typeof b==="undefined")return e(this.el,a);d.each(function(c){e(c,a,b)})},append:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",a):this.el.innerHTML=
|
||||
this.el.innerHTML+a},prepend:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",a):this.el.innerHTML=a+this.el.innerHTML},html:function(a){if(typeof a!=="undefined")this.el.innerHTML=a;return this.el.innerHTML}});if(typeof window.XMLHttpRequest!=="undefined"){var g={_do:function(a,b,c,f,j){var d=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});j=j?"POST":"GET";a=a+(j==="GET"?"?"+this._serialize(b):"");d.open(j,a);d.onreadystatechange=function(){d.readyState===
|
||||
4&&(d.status===200?c.call(d.responseText,d.responseText):typeof f!=="undefined"&&f.call(d.status,d.status))};if(j==="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(this._serialize(b))}else d.send(null)},_serialize:function(a){var b,c,f=[];for(b in a)if(a.hasOwnProperty(b)&&typeof a[b]!=="function"){c=a[b].toString();b=encodeURIComponent(b);c=encodeURIComponent(c);f.push(b+"="+c)}return f.join("&")}};d.ext("get",function(a,b,c,f){g._do(a,b,c,f,false)});d.ext("post",
|
||||
function(a,b,c,f){g._do(a,b,c,f,true)});d.ext("sse",function(a,b){var c;if(typeof EventSource!=="undefined"){c=new EventSource(a);c.onmessage=function(a){b.call(a.data,a.data)}}});var i,l,k,q;if(typeof document.addEventListener!=="undefined"){i=function(a,b,c){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,c,false)};l=function(a,b,c){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,c,false)}}else if(typeof document.attachEvent!=="undefined"){i=function(a,b,c){function f(a){c.apply(a)}
|
||||
if(typeof a.attachEvent!=="undefined"){l(b,c);a.attachEvent("on"+b,f);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||[];a.listeners[b].push({callback:c,_listener:f})}else console.log("Failed to _attach event:"+b+" on "+a)};l=function(a,b,c){if(typeof a.detachEvent!=="undefined"){var f=a.KIS_0_6_0;if(f&&f.listeners&&f.listeners[b])for(var d=f.listeners[b],e=d.length,h=0;h<e;h++)if(d[h].callback===c){a.detachEvent("on"+b,d[h]._listener);d.splice(h,1);d.length===
|
||||
0&&delete f.listeners[b];break}}}}k=function(a,b,c,f){var d,e;if(typeof a==="undefined"){console.log(arguments);console.log(b);return false}if(b.match(/^([\w\-]+)$/))f===true?i(a,b,c):l(a,b,c);else{b=b.split(" ");e=b.length;for(d=0;d<e;d++)k(a,b[d],c,f)}};q=function(a,b,c,f){k(a,c,function(c){var e,h,g,c=c||window.event;h=d.$(b,a);for(e in h){g=c.target||c.srcElement;if(g==h[e]){f.call(h[e],c);c.stopPropagation()}}},true)};d.ext("event",{add:function(a,b){d.each(function(c){k(c,a,b,true)})},remove:function(a,
|
||||
b){d.each(function(c){k(c,a,b,false)})},live:function(a,b,c){q(document.documentElement,a,b,c)},delegate:function(a,b,c){d.each(function(f){q(f,a,b,c)})}});if(typeof localStorage==="undefined"||typeof JSON==="undefined")return null;var m=localStorage,n=sessionStorage;d.ext("store",{get:function(a,b){var c=b?n.getItem(a):m.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?n.setItem(a,b):m.setItem(a,b)},remove:function(a,b){b?n.removeItem(a):m.removeItem(a)},getAll:function(a){var b,
|
||||
c={},f,d;d=a?m:n;b=d.length;for(a=0;a<b;a++){f=d.key(a);c[f]=d.getItem(f)}return c},clear:function(a){a?n.clear():m.clear()}});var s=function(a){var b=[],c=0,d={},e,b=r.object_keys(a);b.sort(function(a,b){var c=parseFloat(b),d=parseFloat(a),f=c+""===b,e=d+""===a;return f&&e?c>d?1:c<d?-1:0:f&&!e?1:!f&&e?-1:b>a?1:b<a?-1:0});c=b.length;for(e=0;e<c;e++)d[b[e]]=a[b[e]];return d},r={object_keys:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b},object_values:function(a){var b=[],
|
||||
c;for(c in a)b.push(a[c]);return b},array_combine:function(a,b){var c={},f,e=0;d.type(a)!=="array"&&(a=this.object_values(a));d.type(b)!=="array"&&(b=this.object_values(b));f=a.length;if(f!==b.length){console.log("Object combine requires two arrays of the same size");return false}for(e=0;e<f;e++)c[a[e]]=b[e];return c},object_merge:function(){var a=Array.prototype.slice.call(arguments),b=a.length,c={},f,e=0,g,h,i;f=true;for(g=0;g<b;g++)if(d.type(a[g])!=="array"){f=false;break}if(f){c=[];for(g=0;g<
|
||||
b;g++)c=c.contact(a[g]);return c}for(i=g=0;g<b;g++){f=a[g];if(d.type(f)=="array"){h=0;for(e=f.length;h<e;h++)c[i++]=f[h]}else for(h in f)f.hasOwnProperty(h)&&(parseInt(h,10)+""===h?c[i++]=f[h]:c[h]=f[h])}return c},str_trans:function(a,b,c){var d=[],e=[],g=false,h=0,i=0,k="",l="",o="",m="",n;if(typeof b==="object"){b=s(b);for(n in b)if(b.hasOwnProperty(n)){d.push(n);e.push(b[n])}b=d;c=e}i=a.length;h=b.length;k=typeof c==="string";l=typeof b==="string";for(d=0;d<i;d++){g=false;if(l){a.charAt(d-1);o=
|
||||
a.charAt(d);a.charAt(d+1);for(e=0;e<h;e++)if(o==b.charAt(e)){g=true;break}}else for(e=0;e<h;e++)if(a.substr(d,b[e].length)==b[e]){g=true;d=d+b[e].length-1;break}m=g?m+(k?c.charAt(e):c[e]):m+a.charAt(d)}return m}};d.ext("util",r)}})($_);
|
||||
(function(d){function o(a,b,c){var f,j;if(typeof a.hasAttribute!=="undefined"){a.hasAttribute(b)&&(f=a.getAttribute(b));j=true}else if(typeof a[b]!=="undefined"){f=a[b];j=false}else if(b==="class"&&typeof a.className!=="undefined"){b="className";f=a.className;j=false}if(typeof f==="undefined"&&(typeof c==="undefined"||c===null))return null;if(typeof c==="undefined")return f;typeof c!=="undefined"&&c!==null?j===true?a.setAttribute(b,c):a[b]=c:c===null&&(j===true?a.removeAttribute(b):delete a[b]);return typeof c!==
|
||||
"undefined"?c:f}function p(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function e(a,b,c){var f,b=p(b);f={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&a.style[b]!=="undefined")return a.style[b];if(typeof c==="undefined"&&a.style[f[b]]!=="undefined")return a.style[f[b]];if(typeof a.style[b]!=="undefined"){a.style[b]=c;return null}if(a.style[f[b]]){a.style[f[b]]=c;return null}}typeof document!=="undefined"&&!("classList"in
|
||||
document.createElement("a"))&&function(a){var a=(a.HTMLElement||a.Element).prototype,b=Object,c=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},f=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},j=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},d=function(a,b){if(b==="")throw new j("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new j("INVALID_CHARACTER_ERR",
|
||||
"String contains an invalid character");return f.call(a,b)},h=function(a){for(var b=c.call(a.className),b=b?b.split(/\s+/):[],f=0,j=b.length;f<j;f++)this.push(b[f]);this._updateClassName=function(){a.className=this.toString()}},e=h.prototype=[],g=function(){return new h(this)};j.prototype=Error.prototype;e.item=function(a){return this[a]||null};e.contains=function(a){return d(this,a+"")!==-1};e.add=function(a){a=a+"";if(d(this,a)===-1){this.push(a);this._updateClassName()}};e.remove=function(a){a=
|
||||
d(this,a+"");if(a!==-1){this.splice(a,1);this._updateClassName()}};e.toggle=function(a){a=a+"";d(this,a)===-1?this.add(a):this.remove(a)};e.toString=function(){return this.join(" ")};if(b.defineProperty){e={get:g,enumerable:true,configurable:true};try{b.defineProperty(a,"classList",e)}catch(i){if(i.number===-2146823252){e.enumerable=false;b.defineProperty(a,"classList",e)}}}else b.prototype.__defineGetter__&&a.__defineGetter__("classList",g)}(self);d.ext("dom",{addClass:function(a){d.each(function(b){b.classList.add(a)})},
|
||||
removeClass:function(a){d.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var c=this.el;if(c.length>1&&typeof b==="undefined")return null;if(c.length>1&&typeof b!=="undefined")d.each(function(c){return o(c,a,b)});else return o(c,a,b)},text:function(a){var b,c,f;f=this.el;c=typeof f.textContent!=="undefined"?"textContent":typeof f.innerText!=="undefined"?"innerText":
|
||||
"innerHTML";b=f[c];if(typeof a!=="undefined")return f[c]=a;return b},css:function(a,b){if(typeof b==="undefined")return e(this.el,a);d.each(function(c){e(c,a,b)})},append:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("beforeend",a):this.el.innerHTML=this.el.innerHTML+a},prepend:function(a){typeof document.insertAdjacentHTML!=="undefined"?this.el.insertAdjacentHTML("afterbegin",a):this.el.innerHTML=a+this.el.innerHTML},html:function(a){if(typeof a!=="undefined")this.el.innerHTML=
|
||||
a;return this.el.innerHTML}});if(typeof window.XMLHttpRequest!=="undefined"){var g={_do:function(a,b,c,f,j){var d=new XMLHttpRequest;typeof c==="undefined"&&(c=function(){});j=j?"POST":"GET";a=a+(j==="GET"?"?"+this._serialize(b):"");d.open(j,a);d.onreadystatechange=function(){d.readyState===4&&(d.status===200?c.call(d.responseText,d.responseText):typeof f!=="undefined"&&f.call(d.status,d.status))};if(j==="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(this._serialize(b))}else d.send(null)},
|
||||
_serialize:function(a){var b,c,f=[];for(b in a)if(a.hasOwnProperty(b)&&typeof a[b]!=="function"){c=a[b].toString();b=encodeURIComponent(b);c=encodeURIComponent(c);f.push(b+"="+c)}return f.join("&")}};d.ext("get",function(a,b,c,f){g._do(a,b,c,f,false)});d.ext("post",function(a,b,c,f){g._do(a,b,c,f,true)});d.ext("sse",function(a,b){var c;if(typeof EventSource!=="undefined"){c=new EventSource(a);c.onmessage=function(a){b.call(a.data,a.data)}}});var i,l,k,q;if(typeof document.addEventListener!=="undefined"){i=
|
||||
function(a,b,c){typeof a.addEventListener!=="undefined"&&a.addEventListener(b,c,false)};l=function(a,b,c){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(b,c,false)}}else if(typeof document.attachEvent!=="undefined"){i=function(a,b,c){function f(a){c.apply(a)}if(typeof a.attachEvent!=="undefined"){l(b,c);a.attachEvent("on"+b,f);a=a.KIS_0_6_0=a.KIS_0_6_0||{};a.listeners=a.listeners||{};a.listeners[b]=a.listeners[b]||[];a.listeners[b].push({callback:c,_listener:f})}};l=function(a,
|
||||
b,c){if(typeof a.detachEvent!=="undefined"){var f=a.KIS_0_6_0;if(f&&f.listeners&&f.listeners[b])for(var d=f.listeners[b],e=d.length,h=0;h<e;h++)if(d[h].callback===c){a.detachEvent("on"+b,d[h]._listener);d.splice(h,1);d.length===0&&delete f.listeners[b];break}}}}k=function(a,b,c,f){var d,e;if(typeof a==="undefined")return null;if(b.match(/^([\w\-]+)$/))f===true?i(a,b,c):l(a,b,c);else{b=b.split(" ");e=b.length;for(d=0;d<e;d++)k(a,b[d],c,f)}};q=function(a,b,c,f){k(a,c,function(c){var e,h,g,c=c||window.event;
|
||||
h=d.$(b,a);for(e in h){g=c.target||c.srcElement;if(g==h[e]){f.call(h[e],c);c.stopPropagation()}}},true)};d.ext("event",{add:function(a,b){d.each(function(c){k(c,a,b,true)})},remove:function(a,b){d.each(function(c){k(c,a,b,false)})},live:function(a,b,c){q(document.documentElement,a,b,c)},delegate:function(a,b,c){d.each(function(f){q(f,a,b,c)})}});if(typeof localStorage==="undefined"||typeof JSON==="undefined")return null;var m=localStorage,n=sessionStorage;d.ext("store",{get:function(a,b){var c=b?
|
||||
n.getItem(a):m.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?n.setItem(a,b):m.setItem(a,b)},remove:function(a,b){b?n.removeItem(a):m.removeItem(a)},getAll:function(a){var b,c={},f,d;d=a?m:n;b=d.length;for(a=0;a<b;a++){f=d.key(a);c[f]=d.getItem(f)}return c},clear:function(a){a?n.clear():m.clear()}});var s=function(a){var b=[],c=0,d={},e,b=r.object_keys(a);b.sort(function(a,b){var c=parseFloat(b),d=parseFloat(a),f=c+""===b,e=d+""===a;return f&&e?c>d?1:c<d?-1:0:f&&!e?1:!f&&
|
||||
e?-1:b>a?1:b<a?-1:0});c=b.length;for(e=0;e<c;e++)d[b[e]]=a[b[e]];return d},r={object_keys:function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b},object_values:function(a){var b=[],c;for(c in a)b.push(a[c]);return b},array_combine:function(a,b){var c={},f,e=0;d.type(a)!=="array"&&(a=this.object_values(a));d.type(b)!=="array"&&(b=this.object_values(b));f=a.length;if(f!==b.length){console.log("Object combine requires two arrays of the same size");return false}for(e=0;e<f;e++)c[a[e]]=
|
||||
b[e];return c},object_merge:function(){var a=Array.prototype.slice.call(arguments),b=a.length,c={},f,e=0,g,h,i;f=true;for(g=0;g<b;g++)if(d.type(a[g])!=="array"){f=false;break}if(f){c=[];for(g=0;g<b;g++)c=c.contact(a[g]);return c}for(i=g=0;g<b;g++){f=a[g];if(d.type(f)=="array"){h=0;for(e=f.length;h<e;h++)c[i++]=f[h]}else for(h in f)f.hasOwnProperty(h)&&(parseInt(h,10)+""===h?c[i++]=f[h]:c[h]=f[h])}return c},str_trans:function(a,b,c){var d=[],e=[],g=false,h=0,i=0,k="",l="",o="",m="",n;if(typeof b===
|
||||
"object"){b=s(b);for(n in b)if(b.hasOwnProperty(n)){d.push(n);e.push(b[n])}b=d;c=e}i=a.length;h=b.length;k=typeof c==="string";l=typeof b==="string";for(d=0;d<i;d++){g=false;if(l){a.charAt(d-1);o=a.charAt(d);a.charAt(d+1);for(e=0;e<h;e++)if(o==b.charAt(e)){g=true;break}}else for(e=0;e<h;e++)if(a.substr(d,b[e].length)==b[e]){g=true;d=d+b[e].length-1;break}m=g?m+(k?c.charAt(e):c[e]):m+a.charAt(d)}return m}};d.ext("util",r)}})($_);
|
||||
|
@ -1,4 +1,4 @@
|
||||
//This is used so IE 8 can use the classList api
|
||||
//This is used so IE can use the classList api
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 2011-06-15
|
||||
@ -206,9 +206,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Well, I guess that attribute doesn't exist
|
||||
if (typeof oldVal === "undefined" && (typeof value === "undefined" || value === null))
|
||||
{
|
||||
console.log(value);
|
||||
/*console.log(value);
|
||||
console.log(sel);
|
||||
console.log("Element does not have the selected attribute");
|
||||
console.log("Element does not have the selected attribute");*/
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -294,9 +294,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
sel.style[equi[prop]] = val;
|
||||
return null;
|
||||
}
|
||||
|
||||
//No matches? Well, lets log it for now
|
||||
console.log("Property " + prop + " nor an equivalent seems to exist");
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@ -392,9 +389,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
//Make sure you don't try to get a bunch of elements
|
||||
if (sel.length > 1 && typeof value === "undefined")
|
||||
{
|
||||
console.log(sel);
|
||||
console.log("Must be a singular element");
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
else if (sel.length > 1 && typeof value !== "undefined") //You can set a bunch, though
|
||||
{
|
||||
|
@ -67,10 +67,6 @@
|
||||
_listener: _listener
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
@ -109,9 +105,7 @@
|
||||
|
||||
if(typeof sel === "undefined")
|
||||
{
|
||||
console.log(arguments);
|
||||
console.log(event);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Multiple events? Run recursively!
|
||||
|
@ -3,16 +3,6 @@
|
||||
* @file polyfill.js
|
||||
*/
|
||||
|
||||
// Console.log polyfill for IE 8 stupidity
|
||||
if(typeof window.console === "undefined")
|
||||
{
|
||||
window.console = {
|
||||
log:function(){}
|
||||
};
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* String trim function polyfill
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user