dpn_swagger_engine 2.0.0.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +5 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +22 -0
- data/README.md +123 -0
- data/Rakefile +37 -0
- data/app/assets/fonts/swagger_engine/DroidSans-Bold.ttf +0 -0
- data/app/assets/fonts/swagger_engine/DroidSans.ttf +0 -0
- data/app/assets/images/swagger_engine/collapse.gif +0 -0
- data/app/assets/images/swagger_engine/expand.gif +0 -0
- data/app/assets/images/swagger_engine/explorer_icons.png +0 -0
- data/app/assets/images/swagger_engine/favicon-16x16.png +0 -0
- data/app/assets/images/swagger_engine/favicon-32x32.png +0 -0
- data/app/assets/images/swagger_engine/favicon.ico +0 -0
- data/app/assets/images/swagger_engine/logo_small.png +0 -0
- data/app/assets/images/swagger_engine/pet_store_api.png +0 -0
- data/app/assets/images/swagger_engine/throbber.gif +0 -0
- data/app/assets/images/swagger_engine/wordnik_api.png +0 -0
- data/app/assets/javascripts/swagger_engine/application.js +24 -0
- data/app/assets/javascripts/swagger_engine/lang/ca.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/en.js +56 -0
- data/app/assets/javascripts/swagger_engine/lang/es.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/fr.js +54 -0
- data/app/assets/javascripts/swagger_engine/lang/geo.js +56 -0
- data/app/assets/javascripts/swagger_engine/lang/it.js +52 -0
- data/app/assets/javascripts/swagger_engine/lang/ja.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/ko-kr.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/pl.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/pt.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/ru.js +56 -0
- data/app/assets/javascripts/swagger_engine/lang/tr.js +53 -0
- data/app/assets/javascripts/swagger_engine/lang/translator.js +39 -0
- data/app/assets/javascripts/swagger_engine/lang/zh-cn.js +53 -0
- data/app/assets/javascripts/swagger_engine/lib/backbone-min.js +15 -0
- data/app/assets/javascripts/swagger_engine/lib/es5-shim.js +2065 -0
- data/app/assets/javascripts/swagger_engine/lib/handlebars-4.0.5.js +4608 -0
- data/app/assets/javascripts/swagger_engine/lib/highlight.9.1.0.pack.js +2 -0
- data/app/assets/javascripts/swagger_engine/lib/highlight.9.1.0.pack_extended.js +34 -0
- data/app/assets/javascripts/swagger_engine/lib/jquery-1.8.0.min.js +2 -0
- data/app/assets/javascripts/swagger_engine/lib/jquery.ba-bbq.min.js +18 -0
- data/app/assets/javascripts/swagger_engine/lib/jquery.slideto.min.js +1 -0
- data/app/assets/javascripts/swagger_engine/lib/jquery.wiggle.min.js +8 -0
- data/app/assets/javascripts/swagger_engine/lib/js-yaml.min.js +3 -0
- data/app/assets/javascripts/swagger_engine/lib/jsoneditor.min.js +11 -0
- data/app/assets/javascripts/swagger_engine/lib/lodash.min.js +102 -0
- data/app/assets/javascripts/swagger_engine/lib/marked.js +1272 -0
- data/app/assets/javascripts/swagger_engine/lib/object-assign-pollyfill.js +23 -0
- data/app/assets/javascripts/swagger_engine/lib/sanitize-html.min.js +6 -0
- data/app/assets/javascripts/swagger_engine/lib/swagger-oauth.js +347 -0
- data/app/assets/javascripts/swagger_engine/o2c.html +20 -0
- data/app/assets/javascripts/swagger_engine/swagger-ui.js +24753 -0
- data/app/assets/javascripts/swagger_engine/swagger-ui.min.js +14 -0
- data/app/assets/javascripts/swagger_engine/swagger.json +18 -0
- data/app/assets/stylesheets/swagger_engine/application.css +12 -0
- data/app/assets/stylesheets/swagger_engine/print.css +1367 -0
- data/app/assets/stylesheets/swagger_engine/reset.css +125 -0
- data/app/assets/stylesheets/swagger_engine/screen.css +1494 -0
- data/app/assets/stylesheets/swagger_engine/style.css +250 -0
- data/app/assets/stylesheets/swagger_engine/typography.css +14 -0
- data/app/controllers/swagger_engine/application_controller.rb +16 -0
- data/app/controllers/swagger_engine/swaggers_controller.rb +29 -0
- data/app/helpers/swagger_engine/application_helper.rb +4 -0
- data/app/helpers/swagger_engine/swagger_helper.rb +4 -0
- data/app/views/layouts/swagger_engine/application.html.erb +14 -0
- data/app/views/swagger_engine/swaggers/index.html.erb +7 -0
- data/app/views/swagger_engine/swaggers/o2c.html +20 -0
- data/app/views/swagger_engine/swaggers/show.html.erb +121 -0
- data/bin/rails +12 -0
- data/bin/setup +8 -0
- data/config/routes.rb +4 -0
- data/dpn_swagger_engine.gemspec +36 -0
- data/lib/swagger_engine/engine.rb +37 -0
- data/lib/swagger_engine/version.rb +4 -0
- data/lib/swagger_engine.rb +7 -0
- data/lib/tasks/swagger_engine_tasks.rake +4 -0
- metadata +233 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"警告: 廃止予定",
|
6
|
+
"Implementation Notes":"実装メモ",
|
7
|
+
"Response Class":"レスポンスクラス",
|
8
|
+
"Status":"ステータス",
|
9
|
+
"Parameters":"パラメータ群",
|
10
|
+
"Parameter":"パラメータ",
|
11
|
+
"Value":"値",
|
12
|
+
"Description":"説明",
|
13
|
+
"Parameter Type":"パラメータタイプ",
|
14
|
+
"Data Type":"データタイプ",
|
15
|
+
"Response Messages":"レスポンスメッセージ",
|
16
|
+
"HTTP Status Code":"HTTPステータスコード",
|
17
|
+
"Reason":"理由",
|
18
|
+
"Response Model":"レスポンスモデル",
|
19
|
+
"Request URL":"リクエストURL",
|
20
|
+
"Response Body":"レスポンスボディ",
|
21
|
+
"Response Code":"レスポンスコード",
|
22
|
+
"Response Headers":"レスポンスヘッダ",
|
23
|
+
"Hide Response":"レスポンスを隠す",
|
24
|
+
"Headers":"ヘッダ",
|
25
|
+
"Try it out!":"実際に実行!",
|
26
|
+
"Show/Hide":"表示/非表示",
|
27
|
+
"List Operations":"操作一覧",
|
28
|
+
"Expand Operations":"操作の展開",
|
29
|
+
"Raw":"Raw",
|
30
|
+
"can't parse JSON. Raw result":"JSONへ解釈できません. 未加工の結果",
|
31
|
+
"Model Schema":"モデルスキーマ",
|
32
|
+
"Model":"モデル",
|
33
|
+
"apply":"実行",
|
34
|
+
"Username":"ユーザ名",
|
35
|
+
"Password":"パスワード",
|
36
|
+
"Terms of service":"サービス利用規約",
|
37
|
+
"Created by":"Created by",
|
38
|
+
"See more at":"See more at",
|
39
|
+
"Contact the developer":"開発者に連絡",
|
40
|
+
"api version":"APIバージョン",
|
41
|
+
"Response Content Type":"レスポンス コンテンツタイプ",
|
42
|
+
"fetching resource":"リソースの取得",
|
43
|
+
"fetching resource list":"リソース一覧の取得",
|
44
|
+
"Explore":"Explore",
|
45
|
+
"Show Swagger Petstore Example Apis":"SwaggerペットストアAPIの表示",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.",
|
47
|
+
"Please specify the protocol for":"プロトコルを指定してください",
|
48
|
+
"Can't read swagger JSON from":"次からswagger JSONを読み込めません",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"リソース情報の読み込みが完了しました. Swagger UIを描画しています",
|
50
|
+
"Unable to read api":"APIを読み込めません",
|
51
|
+
"from path":"次のパスから",
|
52
|
+
"server returned":"サーバからの返答"
|
53
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"경고:폐기예정됨",
|
6
|
+
"Implementation Notes":"구현 노트",
|
7
|
+
"Response Class":"응답 클래스",
|
8
|
+
"Status":"상태",
|
9
|
+
"Parameters":"매개변수들",
|
10
|
+
"Parameter":"매개변수",
|
11
|
+
"Value":"값",
|
12
|
+
"Description":"설명",
|
13
|
+
"Parameter Type":"매개변수 타입",
|
14
|
+
"Data Type":"데이터 타입",
|
15
|
+
"Response Messages":"응답 메세지",
|
16
|
+
"HTTP Status Code":"HTTP 상태 코드",
|
17
|
+
"Reason":"원인",
|
18
|
+
"Response Model":"응답 모델",
|
19
|
+
"Request URL":"요청 URL",
|
20
|
+
"Response Body":"응답 본문",
|
21
|
+
"Response Code":"응답 코드",
|
22
|
+
"Response Headers":"응답 헤더",
|
23
|
+
"Hide Response":"응답 숨기기",
|
24
|
+
"Headers":"헤더",
|
25
|
+
"Try it out!":"써보기!",
|
26
|
+
"Show/Hide":"보이기/숨기기",
|
27
|
+
"List Operations":"목록 작업",
|
28
|
+
"Expand Operations":"전개 작업",
|
29
|
+
"Raw":"원본",
|
30
|
+
"can't parse JSON. Raw result":"JSON을 파싱할수 없음. 원본결과:",
|
31
|
+
"Model Schema":"모델 스키마",
|
32
|
+
"Model":"모델",
|
33
|
+
"apply":"적용",
|
34
|
+
"Username":"사용자 이름",
|
35
|
+
"Password":"암호",
|
36
|
+
"Terms of service":"이용약관",
|
37
|
+
"Created by":"작성자",
|
38
|
+
"See more at":"추가정보:",
|
39
|
+
"Contact the developer":"개발자에게 문의",
|
40
|
+
"api version":"api버전",
|
41
|
+
"Response Content Type":"응답Content Type",
|
42
|
+
"fetching resource":"리소스 가져오기",
|
43
|
+
"fetching resource list":"리소스 목록 가져오기",
|
44
|
+
"Explore":"탐색",
|
45
|
+
"Show Swagger Petstore Example Apis":"Swagger Petstore 예제 보기",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"서버로부터 읽어들일수 없습니다. access-control-origin 설정이 올바르지 않을수 있습니다.",
|
47
|
+
"Please specify the protocol for":"다음을 위한 프로토콜을 정하세요",
|
48
|
+
"Can't read swagger JSON from":"swagger JSON 을 다음으로 부터 읽을수 없습니다",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"리소스 정보 불러오기 완료. Swagger UI 랜더링",
|
50
|
+
"Unable to read api":"api를 읽을 수 없습니다.",
|
51
|
+
"from path":"다음 경로로 부터",
|
52
|
+
"server returned":"서버 응답함."
|
53
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"Uwaga: Wycofane",
|
6
|
+
"Implementation Notes":"Uwagi Implementacji",
|
7
|
+
"Response Class":"Klasa Odpowiedzi",
|
8
|
+
"Status":"Status",
|
9
|
+
"Parameters":"Parametry",
|
10
|
+
"Parameter":"Parametr",
|
11
|
+
"Value":"Wartość",
|
12
|
+
"Description":"Opis",
|
13
|
+
"Parameter Type":"Typ Parametru",
|
14
|
+
"Data Type":"Typ Danych",
|
15
|
+
"Response Messages":"Wiadomości Odpowiedzi",
|
16
|
+
"HTTP Status Code":"Kod Statusu HTTP",
|
17
|
+
"Reason":"Przyczyna",
|
18
|
+
"Response Model":"Model Odpowiedzi",
|
19
|
+
"Request URL":"URL Wywołania",
|
20
|
+
"Response Body":"Treść Odpowiedzi",
|
21
|
+
"Response Code":"Kod Odpowiedzi",
|
22
|
+
"Response Headers":"Nagłówki Odpowiedzi",
|
23
|
+
"Hide Response":"Ukryj Odpowiedź",
|
24
|
+
"Headers":"Nagłówki",
|
25
|
+
"Try it out!":"Wypróbuj!",
|
26
|
+
"Show/Hide":"Pokaż/Ukryj",
|
27
|
+
"List Operations":"Lista Operacji",
|
28
|
+
"Expand Operations":"Rozwiń Operacje",
|
29
|
+
"Raw":"Nieprzetworzone",
|
30
|
+
"can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
|
31
|
+
"Model Schema":"Schemat Modelu",
|
32
|
+
"Model":"Model",
|
33
|
+
"apply":"użyj",
|
34
|
+
"Username":"Nazwa użytkownika",
|
35
|
+
"Password":"Hasło",
|
36
|
+
"Terms of service":"Warunki używania",
|
37
|
+
"Created by":"Utworzone przez",
|
38
|
+
"See more at":"Zobacz więcej na",
|
39
|
+
"Contact the developer":"Kontakt z deweloperem",
|
40
|
+
"api version":"wersja api",
|
41
|
+
"Response Content Type":"Typ Zasobu Odpowiedzi",
|
42
|
+
"fetching resource":"ładowanie zasobu",
|
43
|
+
"fetching resource list":"ładowanie listy zasobów",
|
44
|
+
"Explore":"Eksploruj",
|
45
|
+
"Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.",
|
47
|
+
"Please specify the protocol for":"Proszę podać protokół dla",
|
48
|
+
"Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
|
50
|
+
"Unable to read api":"Nie można odczytać api",
|
51
|
+
"from path":"ze ścieżki",
|
52
|
+
"server returned":"serwer zwrócił"
|
53
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"Aviso: Depreciado",
|
6
|
+
"Implementation Notes":"Notas de Implementação",
|
7
|
+
"Response Class":"Classe de resposta",
|
8
|
+
"Status":"Status",
|
9
|
+
"Parameters":"Parâmetros",
|
10
|
+
"Parameter":"Parâmetro",
|
11
|
+
"Value":"Valor",
|
12
|
+
"Description":"Descrição",
|
13
|
+
"Parameter Type":"Tipo de parâmetro",
|
14
|
+
"Data Type":"Tipo de dados",
|
15
|
+
"Response Messages":"Mensagens de resposta",
|
16
|
+
"HTTP Status Code":"Código de status HTTP",
|
17
|
+
"Reason":"Razão",
|
18
|
+
"Response Model":"Modelo resposta",
|
19
|
+
"Request URL":"URL requisição",
|
20
|
+
"Response Body":"Corpo da resposta",
|
21
|
+
"Response Code":"Código da resposta",
|
22
|
+
"Response Headers":"Cabeçalho da resposta",
|
23
|
+
"Headers":"Cabeçalhos",
|
24
|
+
"Hide Response":"Esconder resposta",
|
25
|
+
"Try it out!":"Tente agora!",
|
26
|
+
"Show/Hide":"Mostrar/Esconder",
|
27
|
+
"List Operations":"Listar operações",
|
28
|
+
"Expand Operations":"Expandir operações",
|
29
|
+
"Raw":"Cru",
|
30
|
+
"can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
|
31
|
+
"Model Schema":"Modelo esquema",
|
32
|
+
"Model":"Modelo",
|
33
|
+
"apply":"Aplicar",
|
34
|
+
"Username":"Usuário",
|
35
|
+
"Password":"Senha",
|
36
|
+
"Terms of service":"Termos do serviço",
|
37
|
+
"Created by":"Criado por",
|
38
|
+
"See more at":"Veja mais em",
|
39
|
+
"Contact the developer":"Contate o desenvolvedor",
|
40
|
+
"api version":"Versão api",
|
41
|
+
"Response Content Type":"Tipo de conteúdo da resposta",
|
42
|
+
"fetching resource":"busca recurso",
|
43
|
+
"fetching resource list":"buscando lista de recursos",
|
44
|
+
"Explore":"Explorar",
|
45
|
+
"Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
|
47
|
+
"Please specify the protocol for":"Por favor especifique o protocolo",
|
48
|
+
"Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
|
50
|
+
"Unable to read api":"Não foi possível ler api",
|
51
|
+
"from path":"do caminho",
|
52
|
+
"server returned":"servidor retornou"
|
53
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"Предупреждение: Устарело",
|
6
|
+
"Implementation Notes":"Заметки",
|
7
|
+
"Response Class":"Пример ответа",
|
8
|
+
"Status":"Статус",
|
9
|
+
"Parameters":"Параметры",
|
10
|
+
"Parameter":"Параметр",
|
11
|
+
"Value":"Значение",
|
12
|
+
"Description":"Описание",
|
13
|
+
"Parameter Type":"Тип параметра",
|
14
|
+
"Data Type":"Тип данных",
|
15
|
+
"HTTP Status Code":"HTTP код",
|
16
|
+
"Reason":"Причина",
|
17
|
+
"Response Model":"Структура ответа",
|
18
|
+
"Request URL":"URL запроса",
|
19
|
+
"Response Body":"Тело ответа",
|
20
|
+
"Response Code":"HTTP код ответа",
|
21
|
+
"Response Headers":"Заголовки ответа",
|
22
|
+
"Hide Response":"Спрятать ответ",
|
23
|
+
"Headers":"Заголовки",
|
24
|
+
"Response Messages":"Что может прийти в ответ",
|
25
|
+
"Try it out!":"Попробовать!",
|
26
|
+
"Show/Hide":"Показать/Скрыть",
|
27
|
+
"List Operations":"Операции кратко",
|
28
|
+
"Expand Operations":"Операции подробно",
|
29
|
+
"Raw":"В сыром виде",
|
30
|
+
"can't parse JSON. Raw result":"Не удается распарсить ответ:",
|
31
|
+
"Example Value":"Пример",
|
32
|
+
"Model Schema":"Структура",
|
33
|
+
"Model":"Описание",
|
34
|
+
"Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
|
35
|
+
"apply":"применить",
|
36
|
+
"Username":"Имя пользователя",
|
37
|
+
"Password":"Пароль",
|
38
|
+
"Terms of service":"Условия использования",
|
39
|
+
"Created by":"Разработано",
|
40
|
+
"See more at":"Еще тут",
|
41
|
+
"Contact the developer":"Связаться с разработчиком",
|
42
|
+
"api version":"Версия API",
|
43
|
+
"Response Content Type":"Content Type ответа",
|
44
|
+
"Parameter content type:":"Content Type параметра:",
|
45
|
+
"fetching resource":"Получение ресурса",
|
46
|
+
"fetching resource list":"Получение ресурсов",
|
47
|
+
"Explore":"Показать",
|
48
|
+
"Show Swagger Petstore Example Apis":"Показать примеры АПИ",
|
49
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, проблема с настройками доступа",
|
50
|
+
"Please specify the protocol for":"Пожалуйста, укажите протокол для",
|
51
|
+
"Can't read swagger JSON from":"Не получается прочитать swagger json из",
|
52
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
|
53
|
+
"Unable to read api":"Не удалось прочитать api",
|
54
|
+
"from path":"по адресу",
|
55
|
+
"server returned":"сервер сказал"
|
56
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"Uyarı: Deprecated",
|
6
|
+
"Implementation Notes":"Gerçekleştirim Notları",
|
7
|
+
"Response Class":"Dönen Sınıf",
|
8
|
+
"Status":"Statü",
|
9
|
+
"Parameters":"Parametreler",
|
10
|
+
"Parameter":"Parametre",
|
11
|
+
"Value":"Değer",
|
12
|
+
"Description":"Açıklama",
|
13
|
+
"Parameter Type":"Parametre Tipi",
|
14
|
+
"Data Type":"Veri Tipi",
|
15
|
+
"Response Messages":"Dönüş Mesajı",
|
16
|
+
"HTTP Status Code":"HTTP Statü Kodu",
|
17
|
+
"Reason":"Gerekçe",
|
18
|
+
"Response Model":"Dönüş Modeli",
|
19
|
+
"Request URL":"İstek URL",
|
20
|
+
"Response Body":"Dönüş İçeriği",
|
21
|
+
"Response Code":"Dönüş Kodu",
|
22
|
+
"Response Headers":"Dönüş Üst Bilgileri",
|
23
|
+
"Hide Response":"Dönüşü Gizle",
|
24
|
+
"Headers":"Üst Bilgiler",
|
25
|
+
"Try it out!":"Dene!",
|
26
|
+
"Show/Hide":"Göster/Gizle",
|
27
|
+
"List Operations":"Operasyonları Listele",
|
28
|
+
"Expand Operations":"Operasyonları Aç",
|
29
|
+
"Raw":"Ham",
|
30
|
+
"can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
|
31
|
+
"Model Schema":"Model Şema",
|
32
|
+
"Model":"Model",
|
33
|
+
"apply":"uygula",
|
34
|
+
"Username":"Kullanıcı Adı",
|
35
|
+
"Password":"Parola",
|
36
|
+
"Terms of service":"Servis şartları",
|
37
|
+
"Created by":"Oluşturan",
|
38
|
+
"See more at":"Daha fazlası için",
|
39
|
+
"Contact the developer":"Geliştirici ile İletişime Geçin",
|
40
|
+
"api version":"api versiyon",
|
41
|
+
"Response Content Type":"Dönüş İçerik Tipi",
|
42
|
+
"fetching resource":"kaynak getiriliyor",
|
43
|
+
"fetching resource list":"kaynak listesi getiriliyor",
|
44
|
+
"Explore":"Keşfet",
|
45
|
+
"Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
|
47
|
+
"Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
|
48
|
+
"Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
|
50
|
+
"Unable to read api":"api okunamadı",
|
51
|
+
"from path":"yoldan",
|
52
|
+
"server returned":"sunucuya dönüldü"
|
53
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Translator for documentation pages.
|
5
|
+
*
|
6
|
+
* To enable translation you should include one of language-files in your index.html
|
7
|
+
* after <script src='lang/translator.js' type='text/javascript'></script>.
|
8
|
+
* For example - <script src='lang/ru.js' type='text/javascript'></script>
|
9
|
+
*
|
10
|
+
* If you wish to translate some new texts you should do two things:
|
11
|
+
* 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
|
12
|
+
* 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
|
13
|
+
* The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
|
14
|
+
*
|
15
|
+
*/
|
16
|
+
window.SwaggerTranslator = {
|
17
|
+
|
18
|
+
_words:[],
|
19
|
+
|
20
|
+
translate: function(sel) {
|
21
|
+
var $this = this;
|
22
|
+
sel = sel || '[data-sw-translate]';
|
23
|
+
|
24
|
+
$(sel).each(function() {
|
25
|
+
$(this).html($this._tryTranslate($(this).html()));
|
26
|
+
|
27
|
+
$(this).val($this._tryTranslate($(this).val()));
|
28
|
+
$(this).attr('title', $this._tryTranslate($(this).attr('title')));
|
29
|
+
});
|
30
|
+
},
|
31
|
+
|
32
|
+
_tryTranslate: function(word) {
|
33
|
+
return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
|
34
|
+
},
|
35
|
+
|
36
|
+
learn: function(wordsMap) {
|
37
|
+
this._words = wordsMap;
|
38
|
+
}
|
39
|
+
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* jshint quotmark: double */
|
4
|
+
window.SwaggerTranslator.learn({
|
5
|
+
"Warning: Deprecated":"警告:已过时",
|
6
|
+
"Implementation Notes":"实现备注",
|
7
|
+
"Response Class":"响应类",
|
8
|
+
"Status":"状态",
|
9
|
+
"Parameters":"参数",
|
10
|
+
"Parameter":"参数",
|
11
|
+
"Value":"值",
|
12
|
+
"Description":"描述",
|
13
|
+
"Parameter Type":"参数类型",
|
14
|
+
"Data Type":"数据类型",
|
15
|
+
"Response Messages":"响应消息",
|
16
|
+
"HTTP Status Code":"HTTP状态码",
|
17
|
+
"Reason":"原因",
|
18
|
+
"Response Model":"响应模型",
|
19
|
+
"Request URL":"请求URL",
|
20
|
+
"Response Body":"响应体",
|
21
|
+
"Response Code":"响应码",
|
22
|
+
"Response Headers":"响应头",
|
23
|
+
"Hide Response":"隐藏响应",
|
24
|
+
"Headers":"头",
|
25
|
+
"Try it out!":"试一下!",
|
26
|
+
"Show/Hide":"显示/隐藏",
|
27
|
+
"List Operations":"显示操作",
|
28
|
+
"Expand Operations":"展开操作",
|
29
|
+
"Raw":"原始",
|
30
|
+
"can't parse JSON. Raw result":"无法解析JSON. 原始结果",
|
31
|
+
"Model Schema":"模型架构",
|
32
|
+
"Model":"模型",
|
33
|
+
"apply":"应用",
|
34
|
+
"Username":"用户名",
|
35
|
+
"Password":"密码",
|
36
|
+
"Terms of service":"服务条款",
|
37
|
+
"Created by":"创建者",
|
38
|
+
"See more at":"查看更多:",
|
39
|
+
"Contact the developer":"联系开发者",
|
40
|
+
"api version":"api版本",
|
41
|
+
"Response Content Type":"响应Content Type",
|
42
|
+
"fetching resource":"正在获取资源",
|
43
|
+
"fetching resource list":"正在获取资源列表",
|
44
|
+
"Explore":"浏览",
|
45
|
+
"Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
|
46
|
+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
|
47
|
+
"Please specify the protocol for":"请指定协议:",
|
48
|
+
"Can't read swagger JSON from":"无法读取swagger JSON于",
|
49
|
+
"Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
|
50
|
+
"Unable to read api":"无法读取api",
|
51
|
+
"from path":"从路径",
|
52
|
+
"server returned":"服务器返回"
|
53
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// Backbone.js 1.1.2
|
2
|
+
|
3
|
+
(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r(e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().replace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}};return e});
|
4
|
+
|
5
|
+
// From http://stackoverflow.com/a/19431552
|
6
|
+
// Compatibility override - Backbone 1.1 got rid of the 'options' binding
|
7
|
+
// automatically to views in the constructor - we need to keep that.
|
8
|
+
Backbone.View = (function(View) {
|
9
|
+
return View.extend({
|
10
|
+
constructor: function(options) {
|
11
|
+
this.options = options || {};
|
12
|
+
View.apply(this, arguments);
|
13
|
+
}
|
14
|
+
});
|
15
|
+
})(Backbone.View);
|