Namespace: ns

ns

noscript MVC framework

Version:
  • 0.2.0

Classes

Model
ModelCollection
ModelUniq
Update
View
ViewCollection

Namespaces

action
history
layout
log
M
object
page
request
router
U
V

Members

staticns.events

Global events bus.

staticns.Hobject

Параметры по умолчанию для http-запросов.

static,constantns.IS_TOUCHBoolean

staticns.Lstring

Типы узлов ns.layout

staticns.MAIN_VIEWns.View

Корневой View.

staticns.Rstring

Константы для ns.router.

Properties:
Name Type Default Description
NOT_APP_URL string ns-router-not-app

ID страницы, не относящейся к noscript приложению.

NOT_FOUND string not-found

ID необъявленной/ненайденной страницы

REDIRECT string ns-router-redirect

ID страницы-редиректа. Тут специально выбрано длинное название, чтобы не пересечься с нормальными страницами.

Methods

staticns.assert(truthy, contextName, message)

ns.js, line 120

Выполняет проверку, что первый аргумент истиннен. Если это не так - кидает ошибку.

Name Type Description
truthy ?

Любое значение, которое проверяется на истинность.

contextName string

Контекст для быстрого поиска места возникновения ошибки.

message string

Сообщение об ошибке.

staticns.byClass(className, context){Array.<Node>}

ns.dom.js, line 92

Полифил getElementsByClassName для IE8.

Name Type Description
className string
context Element

staticns.childrenIterator(node){Object}

ns.dom.js, line 56

Возвращает итератор детям ноды.

Name Type Description
node HTMLElement

Нода-контейнер.

staticns.deentityify(s){string}

ns.entityify.js, line 54

Преобразует HTML-сущности в символы.

Name Type Description
s string

Строка

staticns.entityify(s){string}

ns.entityify.js, line 26

Преобразует специальные символы в HTML сущности.

Name Type Description
s string

Строка

staticns.html2node(html){Element}

ns.dom.js, line 40

Generates DOM from HTML-string.

Name Type Description
html string

staticns.http(uri, params, options){Vow.Promise}

ns.http.server.js, line 8

Creates and executes http request (a POST request with json return data type by default).

Name Type Description
uri string
params object

Request parameters.

options object optional

staticns.http(url, params, options){Vow.Promise}

ns.http.client.js, line 8

Creates and executes ajax request (a POST request with json return data type by default).

Name Type Description
url string
params object

Request parameters.

options object optional

Standart jQuery.ajax settings object.

staticns.init()

ns.js, line 91

Производит первоначальную инициализацию noscript.

staticns.initMainView()

ns.js, line 101

Инициализирует корневой View.

staticns.key(prefix, params){string}

ns.js, line 146

Строит ключ по готовому объекту параметров.

Name Type Description
prefix string

Префикс ключа.

params object

Объект с параметрами составляющими ключ.

Returns:
ключа.

staticns.params2query(params){string}

ns.js, line 160

Конкатенирует параметры в GET-запрос

Name Type Description
params object

Параметры запроса

staticns.parseQuery(s){object}

ns.js, line 21

Parse query string to object.

Name Type Description
s string

Query string

staticns.removeNode(node)

ns.dom.js, line 28

Removes node from DOM

Name Type Description
node Element

staticns.renderNode(json, mode, module){HTMLElement}

ns.js, line 84

Накладывает шаблон и возвращает полученную ноду.

Name Type Default Description
json *

Данные

mode string

Модификатор.

module string 'main' optional

Название модуля.

staticns.renderString(json, mode, module){string}

ns.js, line 73

Накладывает шаблон.

Name Type Default Description
json *
mode string

Модификатор.

module string 'main' optional

Название модуля.

staticns.replaceNode(oldNode, newNode){boolean}

ns.dom.js, line 9

Replaces oldNode with newNode

Name Type Description
oldNode Element
newNode Element

staticns.reset()

ns.js, line 182

Clean internal data after tests

staticns.todo()

ns.js, line 12

Удобная функция для расстановки TODO, кидает исключение при вызове.

comments powered by Disqus