Created
July 12, 2013 07:29
-
-
Save iegorov/5982581 to your computer and use it in GitHub Desktop.
Namespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Пространство имен клиентской части терминала платежной системы "Кассервис" | |
*/ | |
var KASSERVISTERM = KASSERVISTERM || {}; | |
KASSERVISTERM.namespace = function (ns_string) {"use strict"; | |
var parts = ns_string.split('.'), | |
parent = KASSERVISTERM, | |
i; | |
// отбросить начальный префикс - имя глобального объекта | |
if (parts[0] === "KASSERVISTERM") { | |
parts = parts.slice(1); | |
} | |
for (i = 0; i < parts.length; i += 1) { | |
// создать свойство, если оно отсутствует | |
if (typeof parent[parts[i]] === "undefined") { | |
parent[parts[i]] = {}; | |
} | |
parent = parent[parts[i]]; | |
} | |
return parent; | |
}; | |
// уровень представления | |
KASSERVISTERM.namespace('KASSERVISTERM.view'); | |
KASSERVISTERM.view = (function () {'use strict'; | |
var | |
i, | |
len, | |
blur_links = function blur_links() { | |
this.blur(); | |
}, | |
/** | |
* Убирает рамочки у <a> для ie | |
*/ | |
clearBlurLinks = function () { | |
var a_tags = document.getElementsByTagName("a"); | |
for (i = 0, len = a_tags.length; i < len; i += 1) { | |
a_tags[i].onfocus = blur_links; | |
} | |
}; | |
return { | |
clearBlurLinks: clearBlurLinks | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment