Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix most go lint warnings

Cette révision appartient à :
PantsuDev 2017-07-23 15:46:29 +10:00
Parent a931b47bff
révision d9142a73c3
54 fichiers modifiés avec 7161 ajouts et 7275 suppressions

25
.htmlhintrc Fichier normal
Voir le fichier

@ -0,0 +1,25 @@
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": false,
"attr-value-not-empty": false,
"doctype-first": true,
"doctype-html5": true,
"head-script-disabled": true,
"href-abs-or-rel": false,
"id-class-ad-disabled": true,
"id-class-value": "dash",
"id-unique": true,
"inline-script-disabled": true,
"inline-style-disabled": true,
"space-tab-mixed-disabled": "space2",
"spec-char-escape": true,
"src-not-empty": true,
"style-disabled": true,
"tag-pair": true,
"tag-self-close": false,
"tagname-lowercase": true,
"title-require": true
}

Voir le fichier

@ -16,4 +16,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Voir le fichier

@ -1,5 +1,5 @@
define({ "api": [ define({
{ "api": [{
"type": "get", "type": "get",
"url": "/search/", "url": "/search/",
"title": "Search Torrents", "title": "Search Torrents",
@ -8,8 +8,7 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
@ -133,45 +132,37 @@ define({ "api": [
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Object[]", "type": "Object[]",
"optional": false, "optional": false,
"field": "torrents", "field": "torrents",
"description": "<p>List of torrent object (see view for the properties).</p>" "description": "<p>List of torrent object (see view for the properties).</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}", "content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
"field": "errors", "field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>" "description": "<p>List of errors messages with a 404 error message in it.</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}", "content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -183,8 +174,7 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
@ -308,45 +298,37 @@ define({ "api": [
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Object[]", "type": "Object[]",
"optional": false, "optional": false,
"field": "torrents", "field": "torrents",
"description": "<p>List of torrent object (see view for the properties).</p>" "description": "<p>List of torrent object (see view for the properties).</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t[...]\n\t\t}", "content": " HTTP/1.1 200 OK\n {\n\t\t\t[...]\n\t\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/_apidoc.js", "filename": "controllers/api/_apidoc.js",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
"field": "errors", "field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>" "description": "<p>List of errors messages with a 404 error message in it.</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}", "content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -358,21 +340,18 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "Number", "type": "Number",
"optional": false, "optional": false,
"field": "id", "field": "id",
"description": "<p>Torrent unique ID.</p>" "description": "<p>Torrent unique ID.</p>"
} }]
]
} }
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Number", "type": "Number",
"optional": false, "optional": false,
@ -535,35 +514,29 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t{\n\t\"id\": 952801,\n\t\"name\": \"[HorribleSubs] Uchouten Kazoku S2 [720p]\",\n\t\"status\": 1,\n\t\"hash\": \"6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"date\": \"2017-07-05T11:01:39Z\",\n\t\"filesize\": 4056160259,\n\t\"description\": \"<p>Unofficial batch</p>\\n\",\n\t\"comments\": [],\n\t\"sub_category\": \"5\",\n\t\"category\": \"3\",\n\t\"anidb_id\": \"\",\n\t\"downloads\": 0,\n\t\"uploader_id\": 7177,\n\t\"uploader_name\": \"DarAR92\",\n\t\"uploader_old\": \"\",\n\t\"website_link\": \"http://horriblesubs.info/\",\n\t\"languages\": [\n\t\"en-us\"\n\t],\n\t\"magnet\": \"magnet:?xt=urn:btih:6E4D96F7A0B0456672E80B150CCB7C15868CD47D&dn=%5BHorribleSubs%5D+Uchouten+Kazoku+S2+%5B720p%5D&tr=http://nyaa.tracker.wf:7777/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.doko.moe:6969&tr=http://tracker.anirena.com:80/announce&tr=http://anidex.moe:6969/announce&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://zer0day.ch:1337&tr=udp://9.rarbg.com:2710/announce&tr=udp://tracker2.christianbro.pw:6969/announce&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://eddie4.nl:6969/announce&tr=udp://tracker.doko.moe:6969/announce\",\n\t\"torrent\": \"https://nyaa.pantsu.cat/download/6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"seeders\": 4,\n\t\"leechers\": 2,\n\t\"completed\": 28,\n\t\"last_scrape\": \"2017-07-07T07:48:32.509635Z\",\n\t\"file_list\": [\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 01[720p].mkv\",\n\t\"filesize\": 338250895\n\t},\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 12 [720p].mkv\",\n\t\"filesize\": 338556275\n\t}\n\t]\n\t}", "content": " HTTP/1.1 200 OK\n\t{\n\t\"id\": 952801,\n\t\"name\": \"[HorribleSubs] Uchouten Kazoku S2 [720p]\",\n\t\"status\": 1,\n\t\"hash\": \"6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"date\": \"2017-07-05T11:01:39Z\",\n\t\"filesize\": 4056160259,\n\t\"description\": \"<p>Unofficial batch</p>\\n\",\n\t\"comments\": [],\n\t\"sub_category\": \"5\",\n\t\"category\": \"3\",\n\t\"anidb_id\": \"\",\n\t\"downloads\": 0,\n\t\"uploader_id\": 7177,\n\t\"uploader_name\": \"DarAR92\",\n\t\"uploader_old\": \"\",\n\t\"website_link\": \"http://horriblesubs.info/\",\n\t\"languages\": [\n\t\"en-us\"\n\t],\n\t\"magnet\": \"magnet:?xt=urn:btih:6E4D96F7A0B0456672E80B150CCB7C15868CD47D&dn=%5BHorribleSubs%5D+Uchouten+Kazoku+S2+%5B720p%5D&tr=http://nyaa.tracker.wf:7777/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.doko.moe:6969&tr=http://tracker.anirena.com:80/announce&tr=http://anidex.moe:6969/announce&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://zer0day.ch:1337&tr=udp://9.rarbg.com:2710/announce&tr=udp://tracker2.christianbro.pw:6969/announce&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://eddie4.nl:6969/announce&tr=udp://tracker.doko.moe:6969/announce\",\n\t\"torrent\": \"https://nyaa.pantsu.cat/download/6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"seeders\": 4,\n\t\"leechers\": 2,\n\t\"completed\": 28,\n\t\"last_scrape\": \"2017-07-07T07:48:32.509635Z\",\n\t\"file_list\": [\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 01[720p].mkv\",\n\t\"filesize\": 338250895\n\t},\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 12 [720p].mkv\",\n\t\"filesize\": 338556275\n\t}\n\t]\n\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
"field": "errors", "field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>" "description": "<p>List of errors messages with a 404 error message in it.</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}", "content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -575,47 +548,39 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "Number", "type": "Number",
"optional": false, "optional": false,
"field": "id", "field": "id",
"description": "<p>Torrent unique ID.</p>" "description": "<p>Torrent unique ID.</p>"
} }]
]
} }
}, },
"success": { "success": {
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": "HTTP/1.1 200 OK", "content": "HTTP/1.1 200 OK",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
"field": "errors", "field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>" "description": "<p>List of errors messages with a 404 error message in it.</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}", "content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -627,21 +592,18 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "Number", "type": "Number",
"optional": false, "optional": false,
"field": "id", "field": "id",
"description": "<p>Torrent unique ID.</p>" "description": "<p>Torrent unique ID.</p>"
} }]
]
} }
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Object[]", "type": "Object[]",
"optional": false, "optional": false,
@ -664,35 +626,29 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}", "content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "String[]", "type": "String[]",
"optional": false, "optional": false,
"field": "errors", "field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>" "description": "<p>List of errors messages with a 404 error message in it.</p>"
} }]
]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}", "content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -704,8 +660,7 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "String", "type": "String",
"optional": false, "optional": false,
@ -780,8 +735,7 @@ define({ "api": [
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -804,20 +758,17 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": "HTTP/1.1 200 OK", "content": "HTTP/1.1 200 OK",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -840,13 +791,11 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }", "content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -858,8 +807,7 @@ define({ "api": [
"group": "Torrents", "group": "Torrents",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "String", "type": "String",
"optional": false, "optional": false,
@ -941,8 +889,7 @@ define({ "api": [
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -965,20 +912,17 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": "HTTP/1.1 200 OK", "content": "HTTP/1.1 200 OK",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Torrents", "groupTitle": "Torrents",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -1001,13 +945,11 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }", "content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -1019,8 +961,7 @@ define({ "api": [
"group": "Users", "group": "Users",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "String", "type": "String",
"optional": false, "optional": false,
@ -1039,8 +980,7 @@ define({ "api": [
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -1063,20 +1003,17 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}", "content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Users", "groupTitle": "Users",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -1099,13 +1036,11 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }", "content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json" "type": "json"
} }]
]
} }
}, },
{ {
@ -1117,21 +1052,18 @@ define({ "api": [
"group": "Users", "group": "Users",
"parameter": { "parameter": {
"fields": { "fields": {
"Parameter": [ "Parameter": [{
{
"group": "Parameter", "group": "Parameter",
"type": "Number", "type": "Number",
"optional": false, "optional": false,
"field": "id", "field": "id",
"description": "<p>User ID.</p>" "description": "<p>User ID.</p>"
} }]
]
} }
}, },
"success": { "success": {
"fields": { "fields": {
"Success 200": [ "Success 200": [{
{
"group": "Success 200", "group": "Success 200",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -1154,20 +1086,17 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Success-Response:", "title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}", "content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
"type": "json" "type": "json"
} }]
]
}, },
"filename": "controllers/api/api.go", "filename": "controllers/api/api.go",
"groupTitle": "Users", "groupTitle": "Users",
"error": { "error": {
"fields": { "fields": {
"Error 4xx": [ "Error 4xx": [{
{
"group": "Error 4xx", "group": "Error 4xx",
"type": "Boolean", "type": "Boolean",
"optional": false, "optional": false,
@ -1190,13 +1119,12 @@ define({ "api": [
} }
] ]
}, },
"examples": [ "examples": [{
{
"title": "Error-Response:", "title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }", "content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json" "type": "json"
}]
}
} }
] ]
} });
}
] });

Voir le fichier

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Loading...</title> <title>Loading...</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -10,39 +11,34 @@
<link href="css/style.css" rel="stylesheet" media="screen, print"> <link href="css/style.css" rel="stylesheet" media="screen, print">
<link href="img/favicon.ico" rel="icon" type="image/x-icon"> <link href="img/favicon.ico" rel="icon" type="image/x-icon">
<script src="vendor/polyfill.js"></script> <script src="vendor/polyfill.js"></script>
</head> </head>
<body>
<script id="template-sidenav" type="text/x-handlebars-template"> <body>
<nav id="scrollingNav">
<script id="template-sidenav" type="text/x-handlebars-template">
<nav id="scrollingNav">
<div class="sidenav-search"> <div class="sidenav-search">
<input class="form-control search" type="text" placeholder="{{__ "Filter..."}}"> <input class="form-control search" type="text" placeholder="{{__ " Filter... "}}">
<span class="search-reset">x</span> <span class="search-reset">x</span>
</div> </div>
<ul class="sidenav nav nav-list list"> <ul class="sidenav nav nav-list list">
{{#each nav}} {{#each nav}} {{#if title}} {{#if isHeader}} {{#if isFixed}}
{{#if title}}
{{#if isHeader}}
{{#if isFixed}}
<li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li> <li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{else}} {{else}}
<li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li> <li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{/if}} {{/if}} {{else}}
{{else}}
<li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}"> <li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
<a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a> <a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
</li> </li>
{{/if}} {{/if}} {{/if}} {{/each}}
{{/if}}
{{/each}}
</ul> </ul>
</nav> </nav>
</script> </script>
<script id="template-project" type="text/x-handlebars-template"> <script id="template-project" type="text/x-handlebars-template">
<div class="pull-left"> <div class="pull-left">
<h1>{{name}}</h1> <h1>{{name}}</h1> {{#if description}}
{{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}} <h2>{{{nl2br description}}}</h2>{{/if}}
</div> </div>
{{#if template.withCompare}} {{#if template.withCompare}}
<div class="pull-right"> <div class="pull-right">
@ -62,46 +58,42 @@
</div> </div>
{{/if}} {{/if}}
<div class="clearfix"></div> <div class="clearfix"></div>
</script> </script>
<script id="template-header" type="text/x-handlebars-template"> <script id="template-header" type="text/x-handlebars-template">
{{#if content}} {{#if content}}
<div id="api-_">{{{content}}}</div> <div id="api-_">{{{content}}}</div>
{{/if}} {{/if}}
</script> </script>
<script id="template-footer" type="text/x-handlebars-template"> <script id="template-footer" type="text/x-handlebars-template">
{{#if content}} {{#if content}}
<div id="api-_footer">{{{content}}}</div> <div id="api-_footer">{{{content}}}</div>
{{/if}} {{/if}}
</script> </script>
<script id="template-generator" type="text/x-handlebars-template"> <script id="template-generator" type="text/x-handlebars-template">
{{#if template.withGenerator}} {{#if template.withGenerator}} {{#if generator}}
{{#if generator}}
<div class="content"> <div class="content">
{{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}} {{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
</div> </div>
{{/if}} {{/if}} {{/if}}
{{/if}} </script>
</script>
<script id="template-sections" type="text/x-handlebars-template"> <script id="template-sections" type="text/x-handlebars-template">
<section id="api-{{group}}"> <section id="api-{{group}}">
<h1>{{underscoreToSpace title}}</h1> <h1>{{underscoreToSpace title}}</h1> {{#if description}}
{{#if description}}
<p>{{{nl2br description}}}</p> <p>{{{nl2br description}}}</p>
{{/if}} {{/if}} {{#each articles}}
{{#each articles}}
<div id="api-{{group}}-{{name}}"> <div id="api-{{group}}-{{name}}">
{{{article}}} {{{article}}}
</div> </div>
{{/each}} {{/each}}
</section> </section>
</script> </script>
<script id="template-article" type="text/x-handlebars-template"> <script id="template-article" type="text/x-handlebars-template">
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}"> <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide" {{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
<div class="pull-left"> <div class="pull-left">
<h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1> <h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
</div> </div>
@ -123,35 +115,23 @@
<div class="clearfix"></div> <div class="clearfix"></div>
{{#if article.deprecated}} {{#if article.deprecated}}
<p class="deprecated"><span>{{__ "DEPRECATED"}}</span> <p class="deprecated"><span>{{__ "DEPRECATED"}}</span> {{{markdown article.deprecated.content}}}
{{{markdown article.deprecated.content}}}
</p> </p>
{{/if}} {{/if}} {{#if article.description}}
{{#if article.description}}
<p>{{{nl2br article.description}}}</p> <p>{{{nl2br article.description}}}</p>
{{/if}} {{/if}}
<span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span> <span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre> <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre> {{#if article.permission}}
{{#if article.permission}}
<p> <p>
{{__ "Permission:"}} {{__ "Permission:"}} {{#each article.permission}} {{name}} {{#if title}}
{{#each article.permission}}
{{name}}
{{#if title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{/if}} {{/each}}
{{/if}}
{{/each}}
</p> </p>
{{/if}} {{/if}} {{#if_gt article.examples.length compare=0}}
{{#if_gt article.examples.length compare=0}}
<ul class="nav nav-tabs nav-tabs-examples"> <ul class="nav nav-tabs nav-tabs-examples">
{{#each article.examples}} {{#each article.examples}}
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}> <li{{#if_eq @index compare=0}} class="active" {{/if_eq}}>
<a href="#examples-{{../id}}-{{@index}}">{{title}}</a> <a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
</li> </li>
{{/each}} {{/each}}
@ -164,26 +144,21 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{/if_gt}} {{/if_gt}} {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}} {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}} {{subTemplate
"article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}} {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} {{subTemplate "article-sample-request"
{{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}} article=article id=id}}
{{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
{{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
{{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
{{subTemplate "article-sample-request" article=article id=id}}
</article> </article>
</script> </script>
<script id="template-article-param-block" type="text/x-handlebars-template"> <script id="template-article-param-block" type="text/x-handlebars-template">
{{#if params}} {{#if params}} {{#each params.fields}}
{{#each params.fields}}
<h2>{{__ @key}}</h2> <h2>{{__ @key}}</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} {{#if ../_hasType}}
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr> </tr>
</thead> </thead>
@ -197,13 +172,11 @@
</td> </td>
{{/if}} {{/if}}
<td> <td>
{{{nl2br description}}} {{{nl2br description}}} {{#if defaultValue}}
{{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}} <p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}} {{#if size}}
{{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}} <p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}} {{#if allowedValues}}
{{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}} <p class="type-size">{{__ "Allowed values:"}} {{#each allowedValues}}
{{#each allowedValues}} <code>{{{this}}}</code>{{#unless @last}}, {{/unless}} {{/each}}
<code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
{{/each}}
</p> </p>
{{/if}} {{/if}}
</td> </td>
@ -211,11 +184,10 @@
{{/each}} {{/each}}
</tbody> </tbody>
</table> </table>
{{/each}} {{/each}} {{#if_gt params.examples.length compare=0}}
{{#if_gt params.examples.length compare=0}}
<ul class="nav nav-tabs nav-tabs-examples"> <ul class="nav nav-tabs nav-tabs-examples">
{{#each params.examples}} {{#each params.examples}}
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}> <li{{#if_eq @index compare=0}} class="active" {{/if_eq}}>
<a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a> <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
</li> </li>
{{/each}} {{/each}}
@ -228,11 +200,10 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{/if_gt}} {{/if_gt}} {{/if}}
{{/if}} </script>
</script>
<script id="template-article-sample-request" type="text/x-handlebars-template"> <script id="template-article-sample-request" type="text/x-handlebars-template">
{{#if article.sampleRequest}} {{#if article.sampleRequest}}
<h2>{{__ "Send a Sample Request"}}</h2> <h2>{{__ "Send a Sample Request"}}</h2>
<form class="form-horizontal"> <form class="form-horizontal">
@ -245,10 +216,8 @@
</div> </div>
</div> </div>
{{#if article.header}} {{#if article.header}} {{#if article.header.fields}}
{{#if article.header.fields}} <h3>{{__ "Headers"}}</h3> {{#each article.header.fields}}
<h3>{{__ "Headers"}}</h3>
{{#each article.header.fields}}
<h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4> <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
<div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}"> <div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
{{#each this}} {{#each this}}
@ -261,27 +230,20 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{/each}} {{/each}} {{/if}} {{/if}} {{#if article.parameter}} {{#if article.parameter.fields}}
{{/if}} <h3>{{__ "Parameters"}}</h3> {{#each article.parameter.fields}}
{{/if}}
{{#if article.parameter}}
{{#if article.parameter.fields}}
<h3>{{__ "Parameters"}}</h3>
{{#each article.parameter.fields}}
<h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4> <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
<div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}"> <div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
{{#each this}} {{#each this}}
<label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label> <label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
<div class="input-group"> <div class="input-group">
<input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}> <input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"
{{/if}}>
<div class="input-group-addon">{{{type}}}</div> <div class="input-group-addon">{{{type}}}</div>
</div> </div>
{{/each}} {{/each}}
</div> </div>
{{/each}} {{/each}} {{/if}} {{/if}}
{{/if}}
{{/if}}
<div class="form-group"> <div class="form-group">
<div class="controls pull-right"> <div class="controls pull-right">
@ -298,10 +260,10 @@
</fieldset> </fieldset>
</form> </form>
{{/if}} {{/if}}
</script> </script>
<script id="template-compare-article" type="text/x-handlebars-template"> <script id="template-compare-article" type="text/x-handlebars-template">
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}"> <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide" {{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
<div class="pull-left"> <div class="pull-left">
<h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1> <h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
</div> </div>
@ -327,316 +289,213 @@
{{#if article.description}} {{#if article.description}}
<p>{{{showDiff article.description compare.description "nl2br"}}}</p> <p>{{{showDiff article.description compare.description "nl2br"}}}</p>
{{else}} {{else}} {{#if compare.description}}
{{#if compare.description}}
<p>{{{showDiff "" compare.description "nl2br"}}}</p> <p>{{{showDiff "" compare.description "nl2br"}}}</p>
{{/if}} {{/if}} {{/if}}
{{/if}}
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre> <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre> {{subTemplate "article-compare-permission" article=article compare=compare}}
{{subTemplate "article-compare-permission" article=article compare=compare}}
<ul class="nav nav-tabs nav-tabs-examples"> <ul class="nav nav-tabs nav-tabs-examples">
{{#each_compare_title article.examples compare.examples}} {{#each_compare_title article.examples compare.examples}} {{#if typeSame}}
{{#if typeSame}} <li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a> <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
</li> </li>
{{/if}} {{/if}} {{#if typeIns}}
<li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
{{#if typeIns}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a> <a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li> </li>
{{/if}} {{/if}} {{#if typeDel}}
<li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
{{#if typeDel}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a> <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li> </li>
{{/if}} {{/if}} {{/each_compare_title}}
{{/each_compare_title}}
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
{{#each_compare_title article.examples compare.examples}} {{#each_compare_title article.examples compare.examples}} {{#if typeSame}}
{{#if typeSame}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{#if typeIns}}
{{#if typeIns}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{#if typeDel}}
{{#if typeDel}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{/each_compare_title}}
{{/each_compare_title}}
</div> </div>
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}} {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}} {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields
{{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}} section="success"}} {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}} {{subTemplate "article-sample-request" article=article id=id}}
{{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
{{subTemplate "article-sample-request" article=article id=id}}
</article> </article>
</script> </script>
<script id="template-article-compare-permission" type="text/x-handlebars-template"> <script id="template-article-compare-permission" type="text/x-handlebars-template">
<p> <p>
{{__ "Permission:"}} {{__ "Permission:"}} {{#each_compare_list_field article.permission compare.permission field="name"}} {{#if source}} {{#if typeSame}} {{source.name}} {{#if source.title}}
{{#each_compare_list_field article.permission compare.permission field="name"}}
{{#if source}}
{{#if typeSame}}
{{source.name}}
{{#if source.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeIns}}
{{#unless _last}}, {{/unless}} <ins>{{source.name}}</ins> {{#if source.title}}
{{/if}}
{{/if}}
{{#if typeIns}}
<ins>{{source.name}}</ins>
{{#if source.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeDel}}
{{#unless _last}}, {{/unless}} <del>{{source.name}}</del> {{#if source.title}}
{{/if}}
{{/if}}
{{#if typeDel}}
<del>{{source.name}}</del>
{{#if source.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{else}} {{#if typeSame}} {{compare.name}} {{#if compare.title}}
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{else}}
{{#if typeSame}}
{{compare.name}}
{{#if compare.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeIns}}
{{#unless _last}}, {{/unless}} <ins>{{compare.name}}</ins> {{#if compare.title}}
{{/if}}
{{/if}}
{{#if typeIns}}
<ins>{{compare.name}}</ins>
{{#if compare.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{#if typeDel}}
{{#unless _last}}, {{/unless}} <del>{{compare.name}}</del> {{#if compare.title}}
{{/if}}
{{/if}}
{{#if typeDel}}
<del>{{compare.name}}</del>
{{#if compare.title}}
<button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover"> <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
</button> </button> {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{/if}} {{/each_compare_list_field}}
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{/if}}
{{/each_compare_list_field}}
</p> </p>
</script> </script>
<script id="template-article-compare-param-block" type="text/x-handlebars-template"> <script id="template-article-compare-param-block" type="text/x-handlebars-template">
{{#if source}} {{#if source}} {{#each_compare_keys source.fields compare.fields}} {{#if typeSame}}
{{#each_compare_keys source.fields compare.fields}}
{{#if typeSame}}
<h2>{{__ source.key}}</h2> <h2>{{__ source.key}}</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} {{#if ../_hasType}}
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr> </tr>
</thead> </thead>
{{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}} {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
</table> </table>
{{/if}} {{/if}} {{#if typeIns}}
{{#if typeIns}}
<h2><ins>{{__ source.key}}</ins></h2> <h2><ins>{{__ source.key}}</ins></h2>
<table class="ins"> <table class="ins">
<thead> <thead>
<tr> <tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} {{#if ../_hasType}}
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr> </tr>
</thead> </thead>
{{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}} {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
</table> </table>
{{/if}} {{/if}} {{#if typeDel}}
{{#if typeDel}}
<h2><del>{{__ compare.key}}</del></h2> <h2><del>{{__ compare.key}}</del></h2>
<table class="del"> <table class="del">
<thead> <thead>
<tr> <tr>
<th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th> <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}} {{#if ../_hasType}}
<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th> <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr> </tr>
</thead> </thead>
{{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}} {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
</table> </table>
{{/if}} {{/if}} {{/each_compare_keys}} {{#if source.examples}}
{{/each_compare_keys}}
{{#if source.examples}}
<ul class="nav nav-tabs nav-tabs-examples"> <ul class="nav nav-tabs nav-tabs-examples">
{{#each_compare_title source.examples compare.examples}} {{#each_compare_title source.examples compare.examples}} {{#if typeSame}}
{{#if typeSame}} <li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a> <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
</li> </li>
{{/if}} {{/if}} {{#if typeIns}}
<li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
{{#if typeIns}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a> <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li> </li>
{{/if}} {{/if}} {{#if typeDel}}
<li{{#if_eq index compare=0}} class="active" {{/if_eq}}>
{{#if typeDel}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a> <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li> </li>
{{/if}} {{/if}} {{/each_compare_title}}
{{/each_compare_title}}
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
{{#each_compare_title source.examples compare.examples}} {{#each_compare_title source.examples compare.examples}} {{#if typeSame}}
{{#if typeSame}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{#if typeIns}}
{{#if typeIns}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{#if typeDel}}
{{#if typeDel}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"> <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre> <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
</div> </div>
{{/if}} {{/if}} {{/each_compare_title}}
{{/each_compare_title}}
</div> </div>
{{/if}} {{/if}} {{/if}}
{{/if}} </script>
</script>
<script id="template-article-compare-param-block-body" type="text/x-handlebars-template"> <script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
<tbody> <tbody>
{{#each_compare_field source compare}} {{#each_compare_field source compare}} {{#if typeSame}}
{{#if typeSame}}
<tr> <tr>
<td class="code"> <td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}} {{{splitFill source.field "." "&nbsp;&nbsp;"}}} {{#if source.optional}} {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span> {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span> {{/if}}
{{#if source.optional}} {{else}} {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}} {{/if}}
{{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
{{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
{{/if}}
{{else}}
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
{{/if}}
</td> </td>
{{#if source.type}} {{#if source.type}} {{#if compare.type}}
{{#if compare.type}}
<td>{{{showDiff source.type compare.type}}}</td> <td>{{{showDiff source.type compare.type}}}</td>
{{else}} {{else}}
<td>{{{source.type}}}</td> <td>{{{source.type}}}</td>
{{/if}} {{/if}} {{else}} {{#if compare.type}}
{{else}}
{{#if compare.type}}
<td>{{{compare.type}}}</td> <td>{{{compare.type}}}</td>
{{else}} {{else}} {{#if ../../../../_hasType}}
{{#if ../../../../_hasType}}<td></td>{{/if}} <td></td>{{/if}} {{/if}} {{/if}}
{{/if}}
{{/if}}
<td> <td>
{{{showDiff source.description compare.description "nl2br"}}} {{{showDiff source.description compare.description "nl2br"}}} {{#if source.defaultValue}}
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}} <p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code>
<p>{{/if}}
</td> </td>
</tr> </tr>
{{/if}} {{/if}} {{#if typeIns}}
{{#if typeIns}}
<tr class="ins"> <tr class="ins">
<td class="code"> <td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}} {{{splitFill source.field "." "&nbsp;&nbsp;"}}} {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
{{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
</td> </td>
{{#if source.type}} {{#if source.type}}
<td>{{{source.type}}}</td> <td>{{{source.type}}}</td>
{{else}} {{else}} {{{typRowTd}}} {{/if}}
{{{typRowTd}}}
{{/if}}
<td> <td>
{{{nl2br source.description}}} {{{nl2br source.description}}} {{#if source.defaultValue}}
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}} <p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code>
<p>{{/if}}
</td> </td>
</tr> </tr>
{{/if}} {{/if}} {{#if typeDel}}
{{#if typeDel}}
<tr class="del"> <tr class="del">
<td class="code"> <td class="code">
{{{splitFill compare.field "." "&nbsp;&nbsp;"}}} {{{splitFill compare.field "." "&nbsp;&nbsp;"}}} {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
</td> </td>
{{#if compare.type}} {{#if compare.type}}
<td>{{{compare.type}}}</td> <td>{{{compare.type}}}</td>
{{else}} {{else}} {{{typRowTd}}} {{/if}}
{{{typRowTd}}}
{{/if}}
<td> <td>
{{{nl2br compare.description}}} {{{nl2br compare.description}}} {{#if compare.defaultValue}}
{{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}} <p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code>
<p>{{/if}}
</td> </td>
</tr> </tr>
{{/if}} {{/if}} {{/each_compare_field}}
{{/each_compare_field}}
</tbody> </tbody>
</script> </script>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div id="sidenav" class="span2"></div> <div id="sidenav" class="span2"></div>
<div id="content"> <div id="content">
@ -647,23 +506,33 @@
<div id="generator"></div> <div id="generator"></div>
</div> </div>
</div> </div>
</div> </div>
<div id="loader"> <div id="loader">
<div class="spinner"> <div class="spinner">
<div class="spinner-container container1"> <div class="spinner-container container1">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> <div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div> </div>
<div class="spinner-container container2"> <div class="spinner-container container2">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> <div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div> </div>
<div class="spinner-container container3"> <div class="spinner-container container3">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div> <div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div> </div>
<p>Loading...</p> <p>Loading...</p>
</div> </div>
</div> </div>
<script data-main="main.js" src="vendor/require.min.js"></script>
</body>
<script data-main="main.js" src="vendor/require.min.js"></script>
</body>
</html> </html>

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ca: { ca: {
'Allowed values:' : 'Valors permesos:', 'Allowed values:': 'Valors permesos:',
'Compare all with predecessor': 'Comparar tot amb versió anterior', 'Compare all with predecessor': 'Comparar tot amb versió anterior',
'compare changes to:' : 'comparar canvis amb:', 'compare changes to:': 'comparar canvis amb:',
'compared to' : 'comparat amb', 'compared to': 'comparat amb',
'Default value:' : 'Valor per defecte:', 'Default value:': 'Valor per defecte:',
'Description' : 'Descripció', 'Description': 'Descripció',
'Field' : 'Camp', 'Field': 'Camp',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generat amb', 'Generated with': 'Generat amb',
'Name' : 'Nom', 'Name': 'Nom',
'No response values.' : 'Sense valors en la resposta.', 'No response values.': 'Sense valors en la resposta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Paràmetre', 'Parameter': 'Paràmetre',
'Permission:' : 'Permisos:', 'Permission:': 'Permisos:',
'Response' : 'Resposta', 'Response': 'Resposta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar una petició d\'exemple', 'Send a Sample Request': 'Enviar una petició d\'exemple',
'show up to version:' : 'mostrar versió:', 'show up to version:': 'mostrar versió:',
'Size range:' : 'Tamany de rang:', 'Size range:': 'Tamany de rang:',
'Type' : 'Tipus', 'Type': 'Tipus',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
de: { de: {
'Allowed values:' : 'Erlaubte Werte:', 'Allowed values:': 'Erlaubte Werte:',
'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
'compare changes to:' : 'vergleiche Änderungen mit:', 'compare changes to:': 'vergleiche Änderungen mit:',
'compared to' : 'verglichen mit', 'compared to': 'verglichen mit',
'Default value:' : 'Standardwert:', 'Default value:': 'Standardwert:',
'Description' : 'Beschreibung', 'Description': 'Beschreibung',
'Field' : 'Feld', 'Field': 'Feld',
'General' : 'Allgemein', 'General': 'Allgemein',
'Generated with' : 'Erstellt mit', 'Generated with': 'Erstellt mit',
'Name' : 'Name', 'Name': 'Name',
'No response values.' : 'Keine Rückgabewerte.', 'No response values.': 'Keine Rückgabewerte.',
'optional' : 'optional', 'optional': 'optional',
'Parameter' : 'Parameter', 'Parameter': 'Parameter',
'Permission:' : 'Berechtigung:', 'Permission:': 'Berechtigung:',
'Response' : 'Antwort', 'Response': 'Antwort',
'Send' : 'Senden', 'Send': 'Senden',
'Send a Sample Request' : 'Eine Beispielanfrage senden', 'Send a Sample Request': 'Eine Beispielanfrage senden',
'show up to version:' : 'zeige bis zur Version:', 'show up to version:': 'zeige bis zur Version:',
'Size range:' : 'Größenbereich:', 'Size range:': 'Größenbereich:',
'Type' : 'Typ', 'Type': 'Typ',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
es: { es: {
'Allowed values:' : 'Valores permitidos:', 'Allowed values:': 'Valores permitidos:',
'Compare all with predecessor': 'Comparar todo con versión anterior', 'Compare all with predecessor': 'Comparar todo con versión anterior',
'compare changes to:' : 'comparar cambios con:', 'compare changes to:': 'comparar cambios con:',
'compared to' : 'comparado con', 'compared to': 'comparado con',
'Default value:' : 'Valor por defecto:', 'Default value:': 'Valor por defecto:',
'Description' : 'Descripción', 'Description': 'Descripción',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generado con', 'Generated with': 'Generado con',
'Name' : 'Nombre', 'Name': 'Nombre',
'No response values.' : 'Sin valores en la respuesta.', 'No response values.': 'Sin valores en la respuesta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Parámetro', 'Parameter': 'Parámetro',
'Permission:' : 'Permisos:', 'Permission:': 'Permisos:',
'Response' : 'Respuesta', 'Response': 'Respuesta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar una petición de ejemplo', 'Send a Sample Request': 'Enviar una petición de ejemplo',
'show up to version:' : 'mostrar a versión:', 'show up to version:': 'mostrar a versión:',
'Size range:' : 'Tamaño de rango:', 'Size range:': 'Tamaño de rango:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
fr: { fr: {
'Allowed values:' : 'Valeurs autorisées :', 'Allowed values:': 'Valeurs autorisées :',
'Compare all with predecessor': 'Tout comparer avec ...', 'Compare all with predecessor': 'Tout comparer avec ...',
'compare changes to:' : 'comparer les changements à :', 'compare changes to:': 'comparer les changements à :',
'compared to' : 'comparer à', 'compared to': 'comparer à',
'Default value:' : 'Valeur par défaut :', 'Default value:': 'Valeur par défaut :',
'Description' : 'Description', 'Description': 'Description',
'Field' : 'Champ', 'Field': 'Champ',
'General' : 'Général', 'General': 'Général',
'Generated with' : 'Généré avec', 'Generated with': 'Généré avec',
'Name' : 'Nom', 'Name': 'Nom',
'No response values.' : 'Aucune valeur de réponse.', 'No response values.': 'Aucune valeur de réponse.',
'optional' : 'optionnel', 'optional': 'optionnel',
'Parameter' : 'Paramètre', 'Parameter': 'Paramètre',
'Permission:' : 'Permission :', 'Permission:': 'Permission :',
'Response' : 'Réponse', 'Response': 'Réponse',
'Send' : 'Envoyer', 'Send': 'Envoyer',
'Send a Sample Request' : 'Envoyer une requête représentative', 'Send a Sample Request': 'Envoyer une requête représentative',
'show up to version:' : 'Montrer à partir de la version :', 'show up to version:': 'Montrer à partir de la version :',
'Size range:' : 'Ordre de grandeur :', 'Size range:': 'Ordre de grandeur :',
'Type' : 'Type', 'Type': 'Type',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
it: { it: {
'Allowed values:' : 'Valori permessi:', 'Allowed values:': 'Valori permessi:',
'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
'compare changes to:' : 'confronta modifiche con:', 'compare changes to:': 'confronta modifiche con:',
'compared to' : 'confrontato con', 'compared to': 'confrontato con',
'Default value:' : 'Valore predefinito:', 'Default value:': 'Valore predefinito:',
'Description' : 'Descrizione', 'Description': 'Descrizione',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'Generale', 'General': 'Generale',
'Generated with' : 'Creato con', 'Generated with': 'Creato con',
'Name' : 'Nome', 'Name': 'Nome',
'No response values.' : 'Nessun valore di risposta.', 'No response values.': 'Nessun valore di risposta.',
'optional' : 'opzionale', 'optional': 'opzionale',
'Parameter' : 'Parametro', 'Parameter': 'Parametro',
'Permission:' : 'Permessi:', 'Permission:': 'Permessi:',
'Response' : 'Risposta', 'Response': 'Risposta',
'Send' : 'Invia', 'Send': 'Invia',
'Send a Sample Request' : 'Invia una richiesta di esempio', 'Send a Sample Request': 'Invia una richiesta di esempio',
'show up to version:' : 'mostra alla versione:', 'show up to version:': 'mostra alla versione:',
'Size range:' : 'Intervallo dimensione:', 'Size range:': 'Intervallo dimensione:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -13,7 +13,7 @@ define([
'./locales/vi.js', './locales/vi.js',
'./locales/zh.js', './locales/zh.js',
'./locales/zh_cn.js' './locales/zh_cn.js'
], function() { ], function () {
var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
var language = langId.substr(0, 2); var language = langId.substr(0, 2);
var locales = {}; var locales = {};
@ -22,10 +22,10 @@ define([
for (property in arguments[index]) for (property in arguments[index])
locales[property] = arguments[index][property]; locales[property] = arguments[index][property];
} }
if ( ! locales['en']) if (!locales['en'])
locales['en'] = {}; locales['en'] = {};
if ( ! locales[langId] && ! locales[language]) if (!locales[langId] && !locales[language])
language = 'en'; language = 'en';
var locale = (locales[langId] ? locales[langId] : locales[language]); var locale = (locales[langId] ? locales[langId] : locales[language]);
@ -42,9 +42,9 @@ define([
} }
return { return {
__ : __, __: __,
locales : locales, locales: locales,
locale : locale, locale: locale,
setLanguage: setLanguage setLanguage: setLanguage
}; };
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
nl: { nl: {
'Allowed values:' : 'Toegestane waarden:', 'Allowed values:': 'Toegestane waarden:',
'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
'compare changes to:' : 'vergelijk veranderingen met:', 'compare changes to:': 'vergelijk veranderingen met:',
'compared to' : 'vergelijk met', 'compared to': 'vergelijk met',
'Default value:' : 'Standaard waarde:', 'Default value:': 'Standaard waarde:',
'Description' : 'Omschrijving', 'Description': 'Omschrijving',
'Field' : 'Veld', 'Field': 'Veld',
'General' : 'Algemeen', 'General': 'Algemeen',
'Generated with' : 'Gegenereerd met', 'Generated with': 'Gegenereerd met',
'Name' : 'Naam', 'Name': 'Naam',
'No response values.' : 'Geen response waardes.', 'No response values.': 'Geen response waardes.',
'optional' : 'optioneel', 'optional': 'optioneel',
'Parameter' : 'Parameter', 'Parameter': 'Parameter',
'Permission:' : 'Permissie:', 'Permission:': 'Permissie:',
'Response' : 'Antwoorden', 'Response': 'Antwoorden',
'Send' : 'Sturen', 'Send': 'Sturen',
'Send a Sample Request' : 'Stuur een sample aanvragen', 'Send a Sample Request': 'Stuur een sample aanvragen',
'show up to version:' : 'toon tot en met versie:', 'show up to version:': 'toon tot en met versie:',
'Size range:' : 'Maatbereik:', 'Size range:': 'Maatbereik:',
'Type' : 'Type', 'Type': 'Type',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
pl: { pl: {
'Allowed values:' : 'Dozwolone wartości:', 'Allowed values:': 'Dozwolone wartości:',
'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
'compare changes to:' : 'porównaj zmiany do:', 'compare changes to:': 'porównaj zmiany do:',
'compared to' : 'porównaj do:', 'compared to': 'porównaj do:',
'Default value:' : 'Wartość domyślna:', 'Default value:': 'Wartość domyślna:',
'Description' : 'Opis', 'Description': 'Opis',
'Field' : 'Pole', 'Field': 'Pole',
'General' : 'Generalnie', 'General': 'Generalnie',
'Generated with' : 'Wygenerowano z', 'Generated with': 'Wygenerowano z',
'Name' : 'Nazwa', 'Name': 'Nazwa',
'No response values.' : 'Brak odpowiedzi.', 'No response values.': 'Brak odpowiedzi.',
'optional' : 'opcjonalny', 'optional': 'opcjonalny',
'Parameter' : 'Parametr', 'Parameter': 'Parametr',
'Permission:' : 'Uprawnienia:', 'Permission:': 'Uprawnienia:',
'Response' : 'Odpowiedź', 'Response': 'Odpowiedź',
'Send' : 'Wyślij', 'Send': 'Wyślij',
'Send a Sample Request' : 'Wyślij przykładowe żądanie', 'Send a Sample Request': 'Wyślij przykładowe żądanie',
'show up to version:' : 'pokaż do wersji:', 'show up to version:': 'pokaż do wersji:',
'Size range:' : 'Zakres rozmiaru:', 'Size range:': 'Zakres rozmiaru:',
'Type' : 'Typ', 'Type': 'Typ',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
'pt_br': { 'pt_br': {
'Allowed values:' : 'Valores permitidos:', 'Allowed values:': 'Valores permitidos:',
'Compare all with predecessor': 'Compare todos com antecessores', 'Compare all with predecessor': 'Compare todos com antecessores',
'compare changes to:' : 'comparar alterações com:', 'compare changes to:': 'comparar alterações com:',
'compared to' : 'comparado com', 'compared to': 'comparado com',
'Default value:' : 'Valor padrão:', 'Default value:': 'Valor padrão:',
'Description' : 'Descrição', 'Description': 'Descrição',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'Geral', 'General': 'Geral',
'Generated with' : 'Gerado com', 'Generated with': 'Gerado com',
'Name' : 'Nome', 'Name': 'Nome',
'No response values.' : 'Sem valores de resposta.', 'No response values.': 'Sem valores de resposta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Parâmetro', 'Parameter': 'Parâmetro',
'Permission:' : 'Permissão:', 'Permission:': 'Permissão:',
'Response' : 'Resposta', 'Response': 'Resposta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 'Send a Sample Request': 'Enviar um Exemplo de Pedido',
'show up to version:' : 'aparecer para a versão:', 'show up to version:': 'aparecer para a versão:',
'Size range:' : 'Faixa de tamanho:', 'Size range:': 'Faixa de tamanho:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ro: { ro: {
'Allowed values:' : 'Valori permise:', 'Allowed values:': 'Valori permise:',
'Compare all with predecessor': 'Compară toate cu versiunea precedentă', 'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
'compare changes to:' : 'compară cu versiunea:', 'compare changes to:': 'compară cu versiunea:',
'compared to' : 'comparat cu', 'compared to': 'comparat cu',
'Default value:' : 'Valoare implicită:', 'Default value:': 'Valoare implicită:',
'Description' : 'Descriere', 'Description': 'Descriere',
'Field' : 'Câmp', 'Field': 'Câmp',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generat cu', 'Generated with': 'Generat cu',
'Name' : 'Nume', 'Name': 'Nume',
'No response values.' : 'Nici o valoare returnată.', 'No response values.': 'Nici o valoare returnată.',
'optional' : 'opțional', 'optional': 'opțional',
'Parameter' : 'Parametru', 'Parameter': 'Parametru',
'Permission:' : 'Permisiune:', 'Permission:': 'Permisiune:',
'Response' : 'Răspuns', 'Response': 'Răspuns',
'Send' : 'Trimite', 'Send': 'Trimite',
'Send a Sample Request' : 'Trimite o cerere de probă', 'Send a Sample Request': 'Trimite o cerere de probă',
'show up to version:' : 'arată până la versiunea:', 'show up to version:': 'arată până la versiunea:',
'Size range:' : 'Interval permis:', 'Size range:': 'Interval permis:',
'Type' : 'Tip', 'Type': 'Tip',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ru: { ru: {
'Allowed values:' : 'Допустимые значения:', 'Allowed values:': 'Допустимые значения:',
'Compare all with predecessor': 'Сравнить с предыдущей версией', 'Compare all with predecessor': 'Сравнить с предыдущей версией',
'compare changes to:' : 'сравнить с:', 'compare changes to:': 'сравнить с:',
'compared to' : 'в сравнении с', 'compared to': 'в сравнении с',
'Default value:' : 'По умолчанию:', 'Default value:': 'По умолчанию:',
'Description' : 'Описание', 'Description': 'Описание',
'Field' : 'Название', 'Field': 'Название',
'General' : 'Общая информация', 'General': 'Общая информация',
'Generated with' : 'Сгенерировано с помощью', 'Generated with': 'Сгенерировано с помощью',
'Name' : 'Название', 'Name': 'Название',
'No response values.' : 'Нет значений для ответа.', 'No response values.': 'Нет значений для ответа.',
'optional' : 'необязательный', 'optional': 'необязательный',
'Parameter' : 'Параметр', 'Parameter': 'Параметр',
'Permission:' : 'Разрешено:', 'Permission:': 'Разрешено:',
'Response' : 'Ответ', 'Response': 'Ответ',
'Send' : 'Отправить', 'Send': 'Отправить',
'Send a Sample Request' : 'Отправить тестовый запрос', 'Send a Sample Request': 'Отправить тестовый запрос',
'show up to version:' : 'показать версию:', 'show up to version:': 'показать версию:',
'Size range:' : 'Ограничения:', 'Size range:': 'Ограничения:',
'Type' : 'Тип', 'Type': 'Тип',
'url' : 'URL' 'url': 'URL'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
tr: { tr: {
'Allowed values:' : 'İzin verilen değerler:', 'Allowed values:': 'İzin verilen değerler:',
'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
'compare changes to:' : 'değişiklikleri karşılaştır:', 'compare changes to:': 'değişiklikleri karşılaştır:',
'compared to' : 'karşılaştır', 'compared to': 'karşılaştır',
'Default value:' : 'Varsayılan değer:', 'Default value:': 'Varsayılan değer:',
'Description' : 'Açıklama', 'Description': 'Açıklama',
'Field' : 'Alan', 'Field': 'Alan',
'General' : 'Genel', 'General': 'Genel',
'Generated with' : 'Oluşturan', 'Generated with': 'Oluşturan',
'Name' : 'İsim', 'Name': 'İsim',
'No response values.' : 'Dönüş verisi yok.', 'No response values.': 'Dönüş verisi yok.',
'optional' : 'opsiyonel', 'optional': 'opsiyonel',
'Parameter' : 'Parametre', 'Parameter': 'Parametre',
'Permission:' : 'İzin:', 'Permission:': 'İzin:',
'Response' : 'Dönüş', 'Response': 'Dönüş',
'Send' : 'Gönder', 'Send': 'Gönder',
'Send a Sample Request' : 'Örnek istek gönder', 'Send a Sample Request': 'Örnek istek gönder',
'show up to version:' : 'bu versiyona kadar göster:', 'show up to version:': 'bu versiyona kadar göster:',
'Size range:' : 'Boyut aralığı:', 'Size range:': 'Boyut aralığı:',
'Type' : 'Tip', 'Type': 'Tip',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
vi: { vi: {
'Allowed values:' : 'Giá trị chấp nhận:', 'Allowed values:': 'Giá trị chấp nhận:',
'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
'compare changes to:' : 'so sánh sự thay đổi với:', 'compare changes to:': 'so sánh sự thay đổi với:',
'compared to' : 'so sánh với', 'compared to': 'so sánh với',
'Default value:' : 'Giá trị mặc định:', 'Default value:': 'Giá trị mặc định:',
'Description' : 'Chú thích', 'Description': 'Chú thích',
'Field' : 'Trường dữ liệu', 'Field': 'Trường dữ liệu',
'General' : 'Tổng quan', 'General': 'Tổng quan',
'Generated with' : 'Được tạo bởi', 'Generated with': 'Được tạo bởi',
'Name' : 'Tên', 'Name': 'Tên',
'No response values.' : 'Không có kết quả trả về.', 'No response values.': 'Không có kết quả trả về.',
'optional' : 'Tùy chọn', 'optional': 'Tùy chọn',
'Parameter' : 'Tham số', 'Parameter': 'Tham số',
'Permission:' : 'Quyền hạn:', 'Permission:': 'Quyền hạn:',
'Response' : 'Kết quả', 'Response': 'Kết quả',
'Send' : 'Gửi', 'Send': 'Gửi',
'Send a Sample Request' : 'Gửi một yêu cầu mẫu', 'Send a Sample Request': 'Gửi một yêu cầu mẫu',
'show up to version:' : 'hiển thị phiên bản:', 'show up to version:': 'hiển thị phiên bản:',
'Size range:' : 'Kích cỡ:', 'Size range:': 'Kích cỡ:',
'Type' : 'Kiểu', 'Type': 'Kiểu',
'url' : 'liên kết' 'url': 'liên kết'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
zh: { zh: {
'Allowed values:' : '允許值:', 'Allowed values:': '允許值:',
'Compare all with predecessor': '預先比較所有', 'Compare all with predecessor': '預先比較所有',
'compare changes to:' : '比較變更:', 'compare changes to:': '比較變更:',
'compared to' : '對比', 'compared to': '對比',
'Default value:' : '默認值:', 'Default value:': '默認值:',
'Description' : '描述', 'Description': '描述',
'Field' : '字段', 'Field': '字段',
'General' : '概括', 'General': '概括',
'Generated with' : '生成工具', 'Generated with': '生成工具',
'Name' : '名稱', 'Name': '名稱',
'No response values.' : '無對應資料.', 'No response values.': '無對應資料.',
'optional' : '選項', 'optional': '選項',
'Parameter' : '參數', 'Parameter': '參數',
'Permission:' : '允許:', 'Permission:': '允許:',
'Response' : '回應', 'Response': '回應',
'Send' : '發送', 'Send': '發送',
'Send a Sample Request' : '發送試用需求', 'Send a Sample Request': '發送試用需求',
'show up to version:' : '顯示到版本:', 'show up to version:': '顯示到版本:',
'Size range:' : '尺寸範圍:', 'Size range:': '尺寸範圍:',
'Type' : '類型', 'Type': '類型',
'url' : '網址' 'url': '網址'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
'zh_cn': { 'zh_cn': {
'Allowed values:' : '允许值:', 'Allowed values:': '允许值:',
'Compare all with predecessor': '与所有较早的比较', 'Compare all with predecessor': '与所有较早的比较',
'compare changes to:' : '将当前版本与指定版本比较:', 'compare changes to:': '将当前版本与指定版本比较:',
'compared to' : '相比于', 'compared to': '相比于',
'Default value:' : '默认值:', 'Default value:': '默认值:',
'Description' : '描述', 'Description': '描述',
'Field' : '字段', 'Field': '字段',
'General' : '概要', 'General': '概要',
'Generated with' : '基于', 'Generated with': '基于',
'Name' : '名称', 'Name': '名称',
'No response values.' : '无返回值.', 'No response values.': '无返回值.',
'optional' : '可选', 'optional': '可选',
'Parameter' : '参数', 'Parameter': '参数',
'Permission:' : '权限:', 'Permission:': '权限:',
'Response' : '返回', 'Response': '返回',
'Send' : '发送', 'Send': '发送',
'Send a Sample Request' : '发送示例请求', 'Send a Sample Request': '发送示例请求',
'show up to version:' : '显示到指定版本:', 'show up to version:': '显示到指定版本:',
'Size range:' : '取值范围:', 'Size range:': '取值范围:',
'Type' : '类型', 'Type': '类型',
'url' : '网址' 'url': '网址'
} }
}); });

Voir le fichier

@ -50,7 +50,7 @@ require([
'bootstrap', 'bootstrap',
'pathToRegexp', 'pathToRegexp',
'list' 'list'
], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) { ], function ($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) {
// load google web fonts // load google web fonts
loadGoogleFontCss(); loadGoogleFontCss();
@ -60,19 +60,19 @@ require([
// //
// Templates // Templates
// //
var templateHeader = Handlebars.compile( $('#template-header').html() ); var templateHeader = Handlebars.compile($('#template-header').html());
var templateFooter = Handlebars.compile( $('#template-footer').html() ); var templateFooter = Handlebars.compile($('#template-footer').html());
var templateArticle = Handlebars.compile( $('#template-article').html() ); var templateArticle = Handlebars.compile($('#template-article').html());
var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() ); var templateCompareArticle = Handlebars.compile($('#template-compare-article').html());
var templateGenerator = Handlebars.compile( $('#template-generator').html() ); var templateGenerator = Handlebars.compile($('#template-generator').html());
var templateProject = Handlebars.compile( $('#template-project').html() ); var templateProject = Handlebars.compile($('#template-project').html());
var templateSections = Handlebars.compile( $('#template-sections').html() ); var templateSections = Handlebars.compile($('#template-sections').html());
var templateSidenav = Handlebars.compile( $('#template-sidenav').html() ); var templateSidenav = Handlebars.compile($('#template-sidenav').html());
// //
// apiProject defaults // apiProject defaults
// //
if ( ! apiProject.template) if (!apiProject.template)
apiProject.template = {}; apiProject.template = {};
if (apiProject.template.withCompare == null) if (apiProject.template.withCompare == null)
@ -91,14 +91,14 @@ require([
// Data transform // Data transform
// //
// grouped by group // grouped by group
var apiByGroup = _.groupBy(api, function(entry) { var apiByGroup = _.groupBy(api, function (entry) {
return entry.group; return entry.group;
}); });
// grouped by group and name // grouped by group and name
var apiByGroupAndName = {}; var apiByGroupAndName = {};
$.each(apiByGroup, function(index, entries) { $.each(apiByGroup, function (index, entries) {
apiByGroupAndName[index] = _.groupBy(entries, function(entry) { apiByGroupAndName[index] = _.groupBy(entries, function (entry) {
return entry.name; return entry.name;
}); });
}); });
@ -107,14 +107,21 @@ require([
// sort api within a group by title ASC and custom order // sort api within a group by title ASC and custom order
// //
var newList = []; var newList = [];
var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0 var umlauts = {
$.each (apiByGroupAndName, function(index, groupEntries) { 'ä': 'ae',
'ü': 'ue',
'ö': 'oe',
'ß': 'ss'
}; // TODO: remove in version 1.0
$.each(apiByGroupAndName, function (index, groupEntries) {
// get titles from the first entry of group[].name[] (name has versioning) // get titles from the first entry of group[].name[] (name has versioning)
var titles = []; var titles = [];
$.each (groupEntries, function(titleName, entries) { $.each(groupEntries, function (titleName, entries) {
var title = entries[0].title; var title = entries[0].title;
if(title !== undefined) { if (title !== undefined) {
title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; }); title.toLowerCase().replace(/[äöüß]/g, function ($0) {
return umlauts[$0];
});
titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting
} }
}); });
@ -126,10 +133,10 @@ require([
titles = sortByOrder(titles, apiProject.order, '#~#'); titles = sortByOrder(titles, apiProject.order, '#~#');
// add single elements to the new list // add single elements to the new list
titles.forEach(function(name) { titles.forEach(function (name) {
var values = name.split('#~#'); var values = name.split('#~#');
var key = values[1]; var key = values[1];
groupEntries[key].forEach(function(entry) { groupEntries[key].forEach(function (entry) {
newList.push(entry); newList.push(entry);
}); });
}); });
@ -145,7 +152,7 @@ require([
var apiVersions = {}; var apiVersions = {};
apiVersions[apiProject.version] = 1; apiVersions[apiProject.version] = 1;
$.each(api, function(index, entry) { $.each(api, function (index, entry) {
apiGroups[entry.group] = 1; apiGroups[entry.group] = 1;
apiGroupTitles[entry.group] = entry.groupTitle || entry.group; apiGroupTitles[entry.group] = entry.groupTitle || entry.group;
apiVersions[entry.version] = 1; apiVersions[entry.version] = 1;
@ -168,7 +175,7 @@ require([
// create Navigationlist // create Navigationlist
// //
var nav = []; var nav = [];
apiGroups.forEach(function(group) { apiGroups.forEach(function (group) {
// Mainmenu entry // Mainmenu entry
nav.push({ nav.push({
group: group, group: group,
@ -178,7 +185,7 @@ require([
// Submenu // Submenu
var oldName = ''; var oldName = '';
api.forEach(function(entry) { api.forEach(function (entry) {
if (entry.group === group) { if (entry.group === group) {
if (oldName !== entry.name) { if (oldName !== entry.name) {
nav.push({ nav.push({
@ -212,18 +219,18 @@ require([
*/ */
function add_nav(nav, content, index) { function add_nav(nav, content, index) {
var found_level1 = false; var found_level1 = false;
if ( ! content) { if (!content) {
return found_level1; return found_level1;
} }
var topics = content.match(/<h(1|2).*?>(.+?)<\/h(1|2)>/gi); var topics = content.match(/<h(1|2).*?>(.+?)<\/h(1|2)>/gi);
if ( topics ) { if (topics) {
topics.forEach(function(entry) { topics.forEach(function (entry) {
var level = entry.substring(2,3); var level = entry.substring(2, 3);
var title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title var title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title
var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/); // Find the group and name in the id property
var group = (entry_tags ? entry_tags[1] : null); var group = (entry_tags ? entry_tags[1] : null);
var name = (entry_tags ? entry_tags[2] : null); var name = (entry_tags ? entry_tags[2] : null);
if (level==1 && title && group) { if (level == 1 && title && group) {
nav.splice(index, 0, { nav.splice(index, 0, {
group: group, group: group,
isHeader: true, isHeader: true,
@ -233,7 +240,7 @@ require([
index++; index++;
found_level1 = true; found_level1 = true;
} }
if (level==2 && title && group && name) { if (level == 2 && title && group && name) {
nav.splice(index, 0, { nav.splice(index, 0, {
group: group, group: group,
name: name, name: name,
@ -287,28 +294,30 @@ require([
var fields = { var fields = {
nav: nav nav: nav
}; };
$('#sidenav').append( templateSidenav(fields) ); $('#sidenav').append(templateSidenav(fields));
// render Generator // render Generator
$('#generator').append( templateGenerator(apiProject) ); $('#generator').append(templateGenerator(apiProject));
// render Project // render Project
_.extend(apiProject, { versions: apiVersions}); _.extend(apiProject, {
$('#project').append( templateProject(apiProject) ); versions: apiVersions
});
$('#project').append(templateProject(apiProject));
// render apiDoc, header/footer documentation // render apiDoc, header/footer documentation
if (apiProject.header) if (apiProject.header)
$('#header').append( templateHeader(apiProject.header) ); $('#header').append(templateHeader(apiProject.header));
if (apiProject.footer) if (apiProject.footer)
$('#footer').append( templateFooter(apiProject.footer) ); $('#footer').append(templateFooter(apiProject.footer));
// //
// Render Sections and Articles // Render Sections and Articles
// //
var articleVersions = {}; var articleVersions = {};
var content = ''; var content = '';
apiGroups.forEach(function(groupEntry) { apiGroups.forEach(function (groupEntry) {
var articles = []; var articles = [];
var oldName = ''; var oldName = '';
var fields = {}; var fields = {};
@ -317,13 +326,13 @@ require([
articleVersions[groupEntry] = {}; articleVersions[groupEntry] = {};
// render all articles of a group // render all articles of a group
api.forEach(function(entry) { api.forEach(function (entry) {
if(groupEntry === entry.group) { if (groupEntry === entry.group) {
if (oldName !== entry.name) { if (oldName !== entry.name) {
// determine versions // determine versions
api.forEach(function(versionEntry) { api.forEach(function (versionEntry) {
if (groupEntry === versionEntry.group && entry.name === versionEntry.name) { if (groupEntry === versionEntry.group && entry.name === versionEntry.name) {
if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) { if (!articleVersions[entry.group].hasOwnProperty(entry.name)) {
articleVersions[entry.group][entry.name] = []; articleVersions[entry.group][entry.name] = [];
} }
articleVersions[entry.group][entry.name].push(versionEntry.version); articleVersions[entry.group][entry.name].push(versionEntry.version);
@ -372,25 +381,32 @@ require([
}; };
content += templateSections(fields); content += templateSections(fields);
}); });
$('#sections').append( content ); $('#sections').append(content);
// Bootstrap Scrollspy // Bootstrap Scrollspy
$(this).scrollspy({ target: '#scrollingNav', offset: 18 }); $(this).scrollspy({
target: '#scrollingNav',
offset: 18
});
// Content-Scroll on Navigation click. // Content-Scroll on Navigation click.
$('.sidenav').find('a').on('click', function(e) { $('.sidenav').find('a').on('click', function (e) {
e.preventDefault(); e.preventDefault();
var id = $(this).attr('href'); var id = $(this).attr('href');
if ($(id).length > 0) if ($(id).length > 0)
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400); $('html,body').animate({
scrollTop: parseInt($(id).offset().top)
}, 400);
window.location.hash = $(this).attr('href'); window.location.hash = $(this).attr('href');
}); });
// Quickjump on Pageload to hash position. // Quickjump on Pageload to hash position.
if(window.location.hash) { if (window.location.hash) {
var id = window.location.hash; var id = window.location.hash;
if ($(id).length > 0) if ($(id).length > 0)
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0); $('html,body').animate({
scrollTop: parseInt($(id).offset().top)
}, 0);
} }
/** /**
@ -402,8 +418,10 @@ require([
*/ */
function _hasTypeInFields(fields) { function _hasTypeInFields(fields) {
var result = false; var result = false;
$.each(fields, function(name) { $.each(fields, function (name) {
result = result || _.some(fields[name], function(item) { return item.type; }); result = result || _.some(fields[name], function (item) {
return item.type;
});
}); });
return result; return result;
} }
@ -413,14 +431,14 @@ require([
*/ */
function initDynamic() { function initDynamic() {
// Bootstrap popover // Bootstrap popover
$('button[data-toggle="popover"]').popover().click(function(e) { $('button[data-toggle="popover"]').popover().click(function (e) {
e.preventDefault(); e.preventDefault();
}); });
var version = $('#version strong').html(); var version = $('#version strong').html();
$('#sidenav li').removeClass('is-new'); $('#sidenav li').removeClass('is-new');
if (apiProject.template.withCompare) { if (apiProject.template.withCompare) {
$('#sidenav li[data-version=\'' + version + '\']').each(function(){ $('#sidenav li[data-version=\'' + version + '\']').each(function () {
var group = $(this).data('group'); var group = $(this).data('group');
var name = $(this).data('name'); var name = $(this).data('name');
var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length; var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length;
@ -459,7 +477,7 @@ require([
// HTML-Template specific jQuery-Functions // HTML-Template specific jQuery-Functions
// //
// Change Main Version // Change Main Version
$('#versions li.version a').on('click', function(e) { $('#versions li.version a').on('click', function (e) {
e.preventDefault(); e.preventDefault();
var selectedVersion = $(this).html(); var selectedVersion = $(this).html();
@ -470,7 +488,7 @@ require([
$('#sidenav li:not(.nav-fixed)').addClass('hide'); $('#sidenav li:not(.nav-fixed)').addClass('hide');
// show 1st equal or lower Version of each entry // show 1st equal or lower Version of each entry
$('article[data-version]').each(function(index) { $('article[data-version]').each(function (index) {
var group = $(this).data('group'); var group = $(this).data('group');
var name = $(this).data('name'); var name = $(this).data('name');
var version = $(this).data('version'); var version = $(this).data('version');
@ -487,7 +505,7 @@ require([
}); });
// show 1st equal or lower Version of each entry // show 1st equal or lower Version of each entry
$('article[data-version]').each(function(index) { $('article[data-version]').each(function (index) {
var group = $(this).data('group'); var group = $(this).data('group');
$('section#api-' + group).removeClass('hide'); $('section#api-' + group).removeClass('hide');
if ($('section#api-' + group + ' article:visible').length === 0) { if ($('section#api-' + group + ' article:visible').length === 0) {
@ -508,7 +526,7 @@ require([
$('article .versions li.version a').on('click', changeVersionCompareTo); $('article .versions li.version a').on('click', changeVersionCompareTo);
// compare url-parameter // compare url-parameter
$.urlParam = function(name) { $.urlParam = function (name) {
var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href); var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
return (results && results[1]) ? results[1] : null; return (results && results[1]) ? results[1] : null;
}; };
@ -519,7 +537,9 @@ require([
if (window.location.hash) { if (window.location.hash) {
var id = window.location.hash; var id = window.location.hash;
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0); $('html,body').animate({
scrollTop: parseInt($(id).offset().top) - 18
}, 0);
} }
} }
@ -527,7 +547,7 @@ require([
* Initialize search * Initialize search
*/ */
var options = { var options = {
valueNames: [ 'nav-list-item' ] valueNames: ['nav-list-item']
}; };
var endpointsList = new List('scrollingNav', options); var endpointsList = new List('scrollingNav', options);
@ -539,18 +559,17 @@ require([
/** /**
* Detect ESC key to reset search * Detect ESC key to reset search
*/ */
$(document).keyup(function(e) { $(document).keyup(function (e) {
if (e.keyCode === 27) $('span.search-reset').click(); if (e.keyCode === 27) $('span.search-reset').click();
}); });
/** /**
* Search reset * Search reset
*/ */
$('span.search-reset').on('click', function() { $('span.search-reset').on('click', function () {
$('#scrollingNav .sidenav-search input.search') $('#scrollingNav .sidenav-search input.search')
.val("") .val("")
.focus() .focus();
;
endpointsList.search(); endpointsList.search();
}); });
@ -575,7 +594,7 @@ require([
if (compareVersion === selectedVersion) if (compareVersion === selectedVersion)
return; return;
if ( ! compareVersion && version == selectedVersion) if (!compareVersion && version == selectedVersion)
return; return;
if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) { if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) {
@ -586,7 +605,7 @@ require([
var sourceEntry = {}; var sourceEntry = {};
var compareEntry = {}; var compareEntry = {};
$.each(apiByGroupAndName[group][name], function(index, entry) { $.each(apiByGroupAndName[group][name], function (index, entry) {
if (entry.version === version) if (entry.version === version)
sourceEntry = entry; sourceEntry = entry;
if (entry.version === selectedVersion) if (entry.version === selectedVersion)
@ -655,17 +674,17 @@ require([
*/ */
function changeAllVersionCompareTo(e) { function changeAllVersionCompareTo(e) {
e.preventDefault(); e.preventDefault();
$('article:visible .versions').each(function(){ $('article:visible .versions').each(function () {
var $root = $(this).parents('article'); var $root = $(this).parents('article');
var currentVersion = $root.data('version'); var currentVersion = $root.data('version');
var $foundElement = null; var $foundElement = null;
$(this).find('li.version a').each(function() { $(this).find('li.version a').each(function () {
var selectVersion = $(this).html(); var selectVersion = $(this).html();
if (selectVersion < currentVersion && ! $foundElement) if (selectVersion < currentVersion && !$foundElement)
$foundElement = $(this); $foundElement = $(this);
}); });
if($foundElement) if ($foundElement)
$foundElement.trigger('click'); $foundElement.trigger('click');
}); });
initDynamic(); initDynamic();
@ -687,7 +706,9 @@ require([
reversed.forEach(function (item, index) { reversed.forEach(function (item, index) {
var parts = item.field.split("."); var parts = item.field.split(".");
if (parts.length - 1 == dot_count) { if (parts.length - 1 == dot_count) {
var fields_names = fields.map(function (item) { return item.field; }); var fields_names = fields.map(function (item) {
return item.field;
});
if (parts.slice(1).length >= 1) { if (parts.slice(1).length >= 1) {
var prefix = parts.slice(0, parts.length - 1).join("."); var prefix = parts.slice(0, parts.length - 1).join(".");
var prefix_index = fields_names.indexOf(prefix); var prefix_index = fields_names.indexOf(prefix);
@ -745,7 +766,7 @@ require([
*/ */
function renderArticle(group, name, version) { function renderArticle(group, name, version) {
var entry = {}; var entry = {};
$.each(apiByGroupAndName[group][name], function(index, currentEntry) { $.each(apiByGroupAndName[group][name], function (index, currentEntry) {
if (currentEntry.version === version) if (currentEntry.version === version)
entry = currentEntry; entry = currentEntry;
}); });
@ -783,7 +804,7 @@ require([
*/ */
function loadGoogleFontCss() { function loadGoogleFontCss() {
WebFont.load({ WebFont.load({
active: function() { active: function () {
// Update scrollspy // Update scrollspy
$(window).scrollspy('refresh') $(window).scrollspy('refresh')
}, },
@ -802,22 +823,22 @@ require([
*/ */
function sortByOrder(elements, order, splitBy) { function sortByOrder(elements, order, splitBy) {
var results = []; var results = [];
order.forEach (function(name) { order.forEach(function (name) {
if (splitBy) if (splitBy)
elements.forEach (function(element) { elements.forEach(function (element) {
var parts = element.split(splitBy); var parts = element.split(splitBy);
var key = parts[1]; // reference keep for sorting var key = parts[1]; // reference keep for sorting
if (key == name) if (key == name)
results.push(element); results.push(element);
}); });
else else
elements.forEach (function(key) { elements.forEach(function (key) {
if (key == name) if (key == name)
results.push(name); results.push(name);
}); });
}); });
// Append all other entries that ar not defined in order // Append all other entries that ar not defined in order
elements.forEach(function(element) { elements.forEach(function (element) {
if (results.indexOf(element) === -1) if (results.indexOf(element) === -1)
results.push(element); results.push(element);
}); });

Voir le fichier

@ -13,8 +13,11 @@ import (
var config *Config var config *Config
var once sync.Once var once sync.Once
// Configpaths default configuration file paths
var Configpaths = []string{"config/config.yml", "config/default_config.yml"} var Configpaths = []string{"config/config.yml", "config/default_config.yml"}
// Get config variable
func Get() *Config { func Get() *Config {
once.Do(func() { once.Do(func() {
config = &Config{} config = &Config{}

Voir le fichier

@ -54,7 +54,7 @@ func getTorrentList(c *gin.Context) (torrents []models.Torrent, createdAsTime ti
} }
if userID != "" { if userID != "" {
userIDnum := 0 var userIDnum int
userIDnum, err = strconv.Atoi(html.EscapeString(userID)) userIDnum, err = strconv.Atoi(html.EscapeString(userID))
// Should we have a feed for anonymous uploads? // Should we have a feed for anonymous uploads?
if err != nil || userIDnum == 0 { if err != nil || userIDnum == 0 {

Voir le fichier

@ -17,7 +17,7 @@ import (
// RSSTorznabHandler : Controller for displaying rss feed, accepting common search arguments // RSSTorznabHandler : Controller for displaying rss feed, accepting common search arguments
func RSSTorznabHandler(c *gin.Context) { func RSSTorznabHandler(c *gin.Context) {
t := c.Query("t") t := c.Query("t")
rss := "" var rss string
title := "Nyaa Pantsu" title := "Nyaa Pantsu"
if config.IsSukebei() { if config.IsSukebei() {
title = "Sukebei Pantsu" title = "Sukebei Pantsu"

Voir le fichier

@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
// Middleware for managing errors on status // ErrorMiddleware for managing errors on status
func ErrorMiddleware() gin.HandlerFunc { func ErrorMiddleware() gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
c.Next() c.Next()

Voir le fichier

@ -113,7 +113,7 @@ func torrentManyAction(c *gin.Context) {
} }
/* Changes are done, we save */ /* Changes are done, we save */
_, err := torrent.UpdateUnscope() _, err = torrent.UpdateUnscope()
if err == nil { if err == nil {
if torrent.Uploader == nil { if torrent.Uploader == nil {
torrent.Uploader = &models.User{} torrent.Uploader = &models.User{}

Voir le fichier

@ -14,7 +14,7 @@ func TorrentReassignModPanel(c *gin.Context) {
templates.Form(c, "admin/reassign.jet.html", torrentValidator.ReassignForm{}) templates.Form(c, "admin/reassign.jet.html", torrentValidator.ReassignForm{})
} }
// ExecuteAction : Function for applying the changes from ReassignForm // ExecuteReassign : Function for applying the changes from ReassignForm
func ExecuteReassign(f *torrentValidator.ReassignForm) (int, error) { func ExecuteReassign(f *torrentValidator.ReassignForm) (int, error) {
var toBeChanged []uint var toBeChanged []uint
var err error var err error

Voir le fichier

@ -17,13 +17,13 @@ import (
func SeePublicSettingsHandler(c *gin.Context) { func SeePublicSettingsHandler(c *gin.Context) {
_, Tlang := publicSettings.GetTfuncAndLanguageFromRequest(c) _, Tlang := publicSettings.GetTfuncAndLanguageFromRequest(c)
availableLanguages := publicSettings.GetAvailableLanguages() availableLanguages := publicSettings.GetAvailableLanguages()
languagesJson := templates.LanguagesJSONResponse{Tlang.Tag, availableLanguages} languagesJSON := templates.LanguagesJSONResponse{Tlang.Tag, availableLanguages}
contentType := c.Request.Header.Get("Content-Type") contentType := c.Request.Header.Get("Content-Type")
if contentType == "application/json" { if contentType == "application/json" {
c.Header("Content-Type", "application/json") c.Header("Content-Type", "application/json")
c.JSON(http.StatusOK, languagesJson) c.JSON(http.StatusOK, languagesJSON)
} else { } else {
templates.Form(c, "site/user/public/settings.jet.html", languagesJson) templates.Form(c, "site/user/public/settings.jet.html", languagesJSON)
} }
} }

Voir le fichier

@ -4,4 +4,4 @@ You can use this API without being logged or any token API
## Except for Upload ## Except for Upload
When you upload, you have to provide your username and api token! When you upload, you have to provide your username and API token!

Voir le fichier

@ -1440,16 +1440,16 @@
"translation": "%s must be less than the current Date & Time" "translation": "%s must be less than the current Date & Time"
}, },
{ {
"id":"error_less_array", "id": "error_less_array",
"translation":"%s must contain less than %s items" "translation": "%s must contain less than %s items"
}, },
{ {
"id": "error_less_length", "id": "error_less_length",
"translation": "%s must be less than %s in length" "translation": "%s must be less than %s in length"
}, },
{ {
"id":"error_less_number", "id": "error_less_number",
"translation":"%s must be less than %s" "translation": "%s must be less than %s"
}, },
{ {
"id": "error_less_equal_date", "id": "error_less_equal_date",
@ -1476,35 +1476,35 @@
"translation": "%s must be equal or less to %s" "translation": "%s must be equal or less to %s"
}, },
{ {
"id":"error_max_length", "id": "error_max_length",
"translation":"Maximal length of %s required for the input: %s" "translation": "Maximal length of %s required for the input: %s"
}, },
{ {
"id":"error_max_number", "id": "error_max_number",
"translation":"%s must be %s or less" "translation": "%s must be %s or less"
}, },
{ {
"id":"error_max_array", "id": "error_max_array",
"translation":"%s must contain at maximum %s items" "translation": "%s must contain at maximum %s items"
}, },
{ {
"id":"error_length", "id": "error_length",
"translation":"Length of %s required for the input: %s" "translation": "Length of %s required for the input: %s"
}, },
{ {
"id":"error_equal", "id": "error_equal",
"translation": "%s is not equal to %s" "translation": "%s is not equal to %s"
}, },
{ {
"id":"error_same_value", "id": "error_same_value",
"translation": "Field '%s' must have the same value as the field '%s'" "translation": "Field '%s' must have the same value as the field '%s'"
}, },
{ {
"id":"error_field", "id": "error_field",
"translation": "Unexpected error on field: %s" "translation": "Unexpected error on field: %s"
}, },
{ {
"id":"error_not_equal", "id": "error_not_equal",
"translation": "%s should not be equal to %s" "translation": "%s should not be equal to %s"
}, },
{ {
@ -1680,7 +1680,7 @@
"translation": "No username/password entered" "translation": "No username/password entered"
}, },
{ {
"id":"account_banned", "id": "account_banned",
"translation": "Account banned" "translation": "Account banned"
}, },
{ {

Voir le fichier

@ -1437,7 +1437,7 @@
}, },
{ {
"id": "error_less_array", "id": "error_less_array",
"translation":"%s doit contenir moins de %s items" "translation": "%s doit contenir moins de %s items"
}, },
{ {
"id": "error_less_length", "id": "error_less_length",
@ -1445,7 +1445,7 @@
}, },
{ {
"id": "error_less_number", "id": "error_less_number",
"translation":"%s doit être inférieur à %s" "translation": "%s doit être inférieur à %s"
}, },
{ {
"id": "error_less_equal_date", "id": "error_less_equal_date",

Voir le fichier

@ -1364,11 +1364,11 @@
"translation": "Minimal length of %s required for the input: %s" "translation": "Minimal length of %s required for the input: %s"
}, },
{ {
"id":"error_max_length", "id": "error_max_length",
"translation":"Maximal length of %s required for the input: %s" "translation": "Maximal length of %s required for the input: %s"
}, },
{ {
"id":"error_same_value", "id": "error_same_value",
"translation": "Must be same %s" "translation": "Must be same %s"
}, },
{ {

Voir le fichier

@ -1440,7 +1440,7 @@
"translation": "%s は現在の日付および時刻より小さくなければなりません" "translation": "%s は現在の日付および時刻より小さくなければなりません"
}, },
{ {
"id":"error_less_array", "id": "error_less_array",
"translation": "%s は %s 個未満のアイテムを含む必要があります" "translation": "%s は %s 個未満のアイテムを含む必要があります"
}, },
{ {
@ -1448,7 +1448,7 @@
"translation": "%s は長さが %s 未満でなければなりません" "translation": "%s は長さが %s 未満でなければなりません"
}, },
{ {
"id":"error_less_number", "id": "error_less_number",
"translation": "%s は %s 未満でなければなりません" "translation": "%s は %s 未満でなければなりません"
}, },
{ {
@ -1476,35 +1476,35 @@
"translation": "%s は %s 以下でなければなりません" "translation": "%s は %s 以下でなければなりません"
}, },
{ {
"id":"error_max_length", "id": "error_max_length",
"translation": "必要な入力値 %s の最大長: %s" "translation": "必要な入力値 %s の最大長: %s"
}, },
{ {
"id":"error_max_number", "id": "error_max_number",
"translation": "%s は %s 以下でなければなりません" "translation": "%s は %s 以下でなければなりません"
}, },
{ {
"id":"error_max_array", "id": "error_max_array",
"translation": "%s にはアイテム %s 個まで含める必要があります" "translation": "%s にはアイテム %s 個まで含める必要があります"
}, },
{ {
"id":"error_length", "id": "error_length",
"translation": "必要な入力値 %s の長さ: %s" "translation": "必要な入力値 %s の長さ: %s"
}, },
{ {
"id":"error_equal", "id": "error_equal",
"translation": "%s は %s と等しくありません" "translation": "%s は %s と等しくありません"
}, },
{ {
"id":"error_same_value", "id": "error_same_value",
"translation": "同じ %s である必要があります" "translation": "同じ %s である必要があります"
}, },
{ {
"id":"error_field", "id": "error_field",
"translation": "フィールドで予期せぬエラーが発生しました: %s" "translation": "フィールドで予期せぬエラーが発生しました: %s"
}, },
{ {
"id":"error_not_equal", "id": "error_not_equal",
"translation": "%s は %s と同じであってはなりません" "translation": "%s は %s と同じであってはなりません"
}, },
{ {
@ -1680,7 +1680,7 @@
"translation": "ユーザー名またはパスワードが入力されていません" "translation": "ユーザー名またはパスワードが入力されていません"
}, },
{ {
"id":"account_banned", "id": "account_banned",
"translation": "アカウントは BAN されています" "translation": "アカウントは BAN されています"
}, },
{ {

Voir le fichier

@ -6,6 +6,7 @@ import (
"github.com/patrickmn/go-cache" "github.com/patrickmn/go-cache"
) )
// C global cache variable
var C *cache.Cache var C *cache.Cache
func init() { func init() {

Voir le fichier

@ -12,10 +12,12 @@ type Category struct {
Name string Name string
} }
// Cateogories is a struct defining an array of categories // Categories is a struct defining an array of categories
type Categories []Category type Categories []Category
var categories Categories var categories Categories
// Index variable
var Index map[string]int var Index map[string]int
// InitCategories init the categories and index variables. Exported for tests // InitCategories init the categories and index variables. Exported for tests

Voir le fichier

@ -159,7 +159,7 @@ func setUserToContext(c *gin.Context, val *models.User) {
context.Set(c.Request, UserContextKey, val) context.Set(c.Request, UserContextKey, val)
} }
// RetrieveUser retrieves a user. // RetrieveUserFromRequest retrieves a user.
func RetrieveUserFromRequest(c *gin.Context, id uint) (*models.User, bool, uint, int, error) { func RetrieveUserFromRequest(c *gin.Context, id uint) (*models.User, bool, uint, int, error) {
var user models.User var user models.User
var currentUserID uint var currentUserID uint

Voir le fichier

@ -13,7 +13,7 @@ import (
"github.com/gorilla/feeds" "github.com/gorilla/feeds"
) )
// private wrapper around the RssFeed which gives us the <rss>..</rss> xml // rssFeedXML private wrapper around the RssFeed which gives us the <rss>..</rss> xml
type rssFeedXML struct { type rssFeedXML struct {
XMLName xml.Name `xml:"rss"` XMLName xml.Name `xml:"rss"`
Xmlns string `xml:"xmlns:torznab,attr,omitempty"` Xmlns string `xml:"xmlns:torznab,attr,omitempty"`
@ -23,6 +23,7 @@ type rssFeedXML struct {
Caps *RssCaps `xml:"caps,omitempty"` Caps *RssCaps `xml:"caps,omitempty"`
} }
// RssImage RSS image struct
type RssImage struct { type RssImage struct {
XMLName xml.Name `xml:"image"` XMLName xml.Name `xml:"image"`
URL string `xml:"url"` URL string `xml:"url"`
@ -32,6 +33,7 @@ type RssImage struct {
Height int `xml:"height,omitempty"` Height int `xml:"height,omitempty"`
} }
// RssTextInput RSS text struct
type RssTextInput struct { type RssTextInput struct {
XMLName xml.Name `xml:"textInput"` XMLName xml.Name `xml:"textInput"`
Title string `xml:"title"` Title string `xml:"title"`
@ -40,11 +42,13 @@ type RssTextInput struct {
Link string `xml:"link"` Link string `xml:"link"`
} }
// RssMagnetLink RSS struct for magnet links
type RssMagnetLink struct { type RssMagnetLink struct {
XMLName xml.Name `xml:"link"` XMLName xml.Name `xml:"link"`
Text string `xml:",cdata"` Text string `xml:",cdata"`
} }
// RssFeed RSS feed struct
type RssFeed struct { type RssFeed struct {
XMLName xml.Name `xml:"channel"` XMLName xml.Name `xml:"channel"`
Xmlns string `xml:"-"` Xmlns string `xml:"-"`
@ -70,6 +74,7 @@ type RssFeed struct {
Items []*RssItem Items []*RssItem
} }
// RssItem struct for rss feed items
type RssItem struct { type RssItem struct {
XMLName xml.Name `xml:"item"` XMLName xml.Name `xml:"item"`
Title string `xml:"title"` // required Title string `xml:"title"` // required
@ -86,6 +91,7 @@ type RssItem struct {
Torznab []*RssTorznab Torznab []*RssTorznab
} }
// RssCaps xml struct for torznab caps
type RssCaps struct { type RssCaps struct {
XMLName xml.Name `xml:"caps"` XMLName xml.Name `xml:"caps"`
Server *RssServer `xml:"server,omitempty"` Server *RssServer `xml:"server,omitempty"`
@ -95,6 +101,7 @@ type RssCaps struct {
Categories *RssCategories `xml:"categories,omitempty"` Categories *RssCategories `xml:"categories,omitempty"`
} }
// RssServer basic server information
type RssServer struct { type RssServer struct {
XMLName xml.Name `xml:"server"` XMLName xml.Name `xml:"server"`
Xmlns string `xml:"xmlns,attr"` Xmlns string `xml:"xmlns,attr"`
@ -106,18 +113,21 @@ type RssServer struct {
Image string `xml:"image,attr"` Image string `xml:"image,attr"`
} }
// RssLimits struct for max results
type RssLimits struct { type RssLimits struct {
XMLName xml.Name `xml:"limits"` XMLName xml.Name `xml:"limits"`
Max string `xml:"max,attr"` Max string `xml:"max,attr"`
Default string `xml:"default,attr"` Default string `xml:"default,attr"`
} }
// RssRegistration torznab registration information
type RssRegistration struct { type RssRegistration struct {
XMLName xml.Name `xml:"registration"` XMLName xml.Name `xml:"registration"`
Available string `xml:"available,attr"` Available string `xml:"available,attr"`
Open string `xml:"open,attr"` Open string `xml:"open,attr"`
} }
// RssSearching struct for supported search types
type RssSearching struct { type RssSearching struct {
XMLName xml.Name `xml:"searching"` XMLName xml.Name `xml:"searching"`
Search *RssSearch `xml:"search,omitempty"` Search *RssSearch `xml:"search,omitempty"`
@ -125,16 +135,19 @@ type RssSearching struct {
MovieSearch *RssSearch `xml:"movie-search,omitempty"` MovieSearch *RssSearch `xml:"movie-search,omitempty"`
} }
// RssSearch struct for supported searching params
type RssSearch struct { type RssSearch struct {
Available string `xml:"available,attr"` Available string `xml:"available,attr"`
SupportedParams string `xml:"supportedParams,attr,omitempty"` SupportedParams string `xml:"supportedParams,attr,omitempty"`
} }
// RssCategories categories for rss
type RssCategories struct { type RssCategories struct {
XMLName xml.Name `xml:"categories"` XMLName xml.Name `xml:"categories"`
Category []*RssCategoryTorznab Category []*RssCategoryTorznab
} }
// RssCategoryTorznab categories for torznab
type RssCategoryTorznab struct { type RssCategoryTorznab struct {
XMLName xml.Name `xml:"category"` XMLName xml.Name `xml:"category"`
ID string `xml:"id,attr"` ID string `xml:"id,attr"`
@ -143,6 +156,7 @@ type RssCategoryTorznab struct {
Description string `xml:"description,attr,omitempty"` Description string `xml:"description,attr,omitempty"`
} }
// RssSubCat sub category
type RssSubCat struct { type RssSubCat struct {
XMLName xml.Name `xml:"subcat"` XMLName xml.Name `xml:"subcat"`
ID string `xml:"id,attr"` ID string `xml:"id,attr"`
@ -150,6 +164,7 @@ type RssSubCat struct {
Description string `xml:"description,attr,omitempty"` Description string `xml:"description,attr,omitempty"`
} }
// RssTorrent item for torrents
type RssTorrent struct { type RssTorrent struct {
XMLName xml.Name `xml:"torrent"` XMLName xml.Name `xml:"torrent"`
Xmlns string `xml:"xmlns,attr"` Xmlns string `xml:"xmlns,attr"`
@ -159,6 +174,7 @@ type RssTorrent struct {
MagnetURI string `xml:"magnetUri,omitempty"` MagnetURI string `xml:"magnetUri,omitempty"`
} }
// RssTorznab feed for torznab
type RssTorznab struct { type RssTorznab struct {
XMLName xml.Name `xml:"torznab:attr,omitempty"` XMLName xml.Name `xml:"torznab:attr,omitempty"`
Name string `xml:"name,attr,omitempty"` Name string `xml:"name,attr,omitempty"`
@ -171,6 +187,7 @@ type RssCategory struct {
Domain string `xml:"domain"` Domain string `xml:"domain"`
} }
// RssEnclosure enclosure for downloads
type RssEnclosure struct { type RssEnclosure struct {
//RSS 2.0 <enclosure url="http://example.com/file.mp3" length="123456789" type="audio/mpeg" /> //RSS 2.0 <enclosure url="http://example.com/file.mp3" length="123456789" type="audio/mpeg" />
XMLName xml.Name `xml:"enclosure"` XMLName xml.Name `xml:"enclosure"`
@ -179,6 +196,7 @@ type RssEnclosure struct {
Type string `xml:"type,attr"` Type string `xml:"type,attr"`
} }
// Rss struct
type Rss struct { type Rss struct {
*feeds.Feed *feeds.Feed
} }
@ -241,22 +259,22 @@ func (r *Rss) RssFeed() *RssFeed {
return channel return channel
} }
// FeedXml : return an XML-Ready object for an Rss object // FeedXML : return an XML-Ready object for an Rss object
func (r *Rss) FeedXml() interface{} { func (r *Rss) FeedXML() interface{} {
// only generate version 2.0 feeds for now // only generate version 2.0 feeds for now
return r.RssFeed().FeedXml() return r.RssFeed().FeedXML()
} }
// FeedXml : return an XML-ready object for an RssFeed object // FeedXML : return an XML-ready object for an RssFeed object
func (r *RssFeed) FeedXml() interface{} { func (r *RssFeed) FeedXML() interface{} {
if r.Xmlns != "" { if r.Xmlns != "" {
return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r, Xmlns: r.Xmlns} return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r, Xmlns: r.Xmlns}
} }
return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r} return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r}
} }
// FeedXml : return an XML-ready object for an RssFeed object // FeedXML : return an XML-ready object for an RssFeed object
func (r *RssCaps) FeedXml() interface{} { func (r *RssCaps) FeedXML() interface{} {
return r return r
} }

Voir le fichier

@ -29,10 +29,11 @@ var htmlFlags = 0 |
md.HTML_HREF_TARGET_BLANK md.HTML_HREF_TARGET_BLANK
func init() { func init() {
HtmlMdRenderer = md.HtmlRenderer(htmlFlags, "", "") HTMLMdRenderer = md.HtmlRenderer(htmlFlags, "", "")
} }
var HtmlMdRenderer md.Renderer // HTMLMdRenderer render for markdown to html
var HTMLMdRenderer md.Renderer
// MarkdownToHTML : convert markdown to html // MarkdownToHTML : convert markdown to html
// TODO: restrict certain types of markdown // TODO: restrict certain types of markdown
@ -41,7 +42,7 @@ func MarkdownToHTML(markdown string) template.HTML {
markdown = ">" + markdown[4:] markdown = ">" + markdown[4:]
} }
markdown = strings.Replace(markdown, "\n&gt;", "\n>", -1) markdown = strings.Replace(markdown, "\n&gt;", "\n>", -1)
unsafe := md.MarkdownOptions([]byte(markdown), HtmlMdRenderer, md.Options{Extensions: mdOptions}) unsafe := md.MarkdownOptions([]byte(markdown), HTMLMdRenderer, md.Options{Extensions: mdOptions})
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
return template.HTML(html) return template.HTML(html)
} }

Voir le fichier

@ -2,6 +2,7 @@ package structs
import "github.com/NyaaPantsu/nyaa/models" import "github.com/NyaaPantsu/nyaa/models"
// TorrentCache torrent cache struct
type TorrentCache struct { type TorrentCache struct {
Torrents []models.Torrent Torrents []models.Torrent
Count int Count int

Voir le fichier

@ -17,19 +17,34 @@ import (
) )
const ( const (
// ShowAll by default show all torrents
ShowAll Status = 0 ShowAll Status = 0
// FilterRemakes filter torrent remakes
FilterRemakes = 2 FilterRemakes = 2
// Trusted trusted torrents
Trusted = 3 Trusted = 3
// APlus torrents not used anymore
APlus = 4 APlus = 4
) )
// Status torrent status
type Status uint8 type Status uint8
// SortMode selected sort mode
type SortMode uint8 type SortMode uint8
// Category torrent categories
type Category struct { type Category struct {
Main, Sub uint8 Main, Sub uint8
} }
// SizeBytes size in bytes
type SizeBytes uint64 type SizeBytes uint64
// DateFilter date to filter for
type DateFilter string type DateFilter string
// Categories multiple torrent categories
type Categories []*Category type Categories []*Category
// TorrentParam defines all parameters that can be provided when searching for a torrent // TorrentParam defines all parameters that can be provided when searching for a torrent

Voir le fichier

@ -13,6 +13,7 @@ var intEvents struct {
funcs []func() funcs []func()
} }
// OnInterrupt handles signal interupts
func OnInterrupt(fn func()) { func OnInterrupt(fn func()) {
intEvents.lock.Lock() intEvents.lock.Lock()
intEvents.funcs = append(intEvents.funcs, fn) intEvents.funcs = append(intEvents.funcs, fn)

Voir le fichier

@ -8,6 +8,7 @@ import (
"syscall" "syscall"
) )
// Handle handles unix interupts
func Handle() { func Handle() {
chnl := make(chan os.Signal) chnl := make(chan os.Signal)
signal.Notify(chnl, syscall.SIGHUP, os.Interrupt) signal.Notify(chnl, syscall.SIGHUP, os.Interrupt)

Voir le fichier

@ -139,6 +139,7 @@ func IsUTFLetterNumericValidator(fl validator.FieldLevel) bool {
return IsUTFLetterNumeric(value) return IsUTFLetterNumeric(value)
} }
// DefaultValidator default validator
func DefaultValidator(fl validator.FieldLevel) bool { func DefaultValidator(fl validator.FieldLevel) bool {
switch fl.Field().Kind() { switch fl.Field().Kind() {
case reflect.String: case reflect.String: