Skip to content
Snippets Groups Projects
Commit 86045fe9 authored by wingedfox's avatar wingedfox
Browse files

JS checks for .hasOwnProperty

This patch includes
- several helper functions - is* checks
- hasOwnProperty method emulator
- checks for .hasOwnProperty in all for..in loops

darcs-hash:20070111114236-00f02-50a71681e5d04faf086f1b8032a384648378b744.gz
parent 14d41eba
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@ function js_out(){
// Array of needed files
$files = array(
DOKU_INC.'lib/scripts/helpers.js',
DOKU_INC.'lib/scripts/events.js',
DOKU_INC.'lib/scripts/cookie.js',
DOKU_INC.'lib/scripts/script.js',
......
......@@ -29,6 +29,7 @@ DokuCookie = {
//save the whole data array
var text = '';
for(var key in DokuCookie.data){
if (!DokuCookie.data.hasOwnProperty(key)) continue;
text += '#'+escape(key)+'#'+DokuCookie.data[key];
}
DokuCookie.setCookie(DokuCookie.name,text.substr(1),now,DOKU_BASE);
......
......@@ -57,6 +57,7 @@ function createPicker(id,list,icobase,edid){
picker.style.display = 'none';
for(var key in list){
if (!list.hasOwnProperty(key)) continue;
var btn = document.createElement('button');
btn.className = 'pickerbutton';
......
......@@ -40,6 +40,7 @@ function handleEvent(event) {
var handlers = this.events[event.type];
// execute each event handler
for (var i in handlers) {
if (!handlers.hasOwnProperty(i)) continue;
this.$$handleEvent = handlers[i];
if (this.$$handleEvent(event) === false) {
returnValue = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment