Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Uprava skriptu pred vydanim 12. dilu

  • Loading branch information...
commit 10a50edaae0f443fba8946e10a524680c9a40dde 1 parent c5aabe7
@JakubMrozek authored
Showing with 105 additions and 6 deletions.
  1. +1 −1  grunt.js
  2. +4 −4 public/js/directives.js
  3. +100 −1 test/frontend/apiary.js
View
2  grunt.js
@@ -27,7 +27,7 @@ module.exports = function (grunt) {
var parser = require('apiary-blueprint-parser');
var content = grunt.file.read('apiary.apib');
var blueprint = parser.parse(content);
- var json = JSON.stringify(blueprint.sections);
+ var json = JSON.stringify(blueprint.sections, null, 2);
grunt.file.write('test/frontend/apiary.js', "var apiary = " + json);
});
View
8 public/js/directives.js
@@ -3,7 +3,7 @@
/* Directives */
/**
- * <inline model='page.text' action='updateDb()'/>
+ * <inline model='page.text' action='updateDb'/>
*/
zdrojak.directive('inline', function(){
var KEY_CODE_ENTER = 13;
@@ -42,11 +42,11 @@ zdrojak.directive('inline', function(){
}
function focusInput() {
- element.children()[1].focus();
+ input[0].focus();
}
function focusArea() {
- element.children()[2].focus();
+ area[0].focus();
}
function focus() {
@@ -73,7 +73,7 @@ zdrojak.directive('inline', function(){
input.bind('keypress', enter);
//po kliknuti na text zobrazit input pro editaci
- span.bind('click', function(el){
+ span.bind('click', function(){
oldContent = element.text().trim();
scope.$apply('mode=true');
focus();
View
101 test/frontend/apiary.js
@@ -1 +1,100 @@
-var apiary = [{"name":"Stranky","description":"","resources":[{"description":"Vrácení seznamu všech stránek.","method":"GET","url":"/pages","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"[\n{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"},\n{\"id\":\"5098eaef0496600200000002\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Obchodní podmínky\",\n\"url\":\"obchodni-podminky\"},\n{\"id\":\"5098eaef0496600200000003\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Doprava a platba\",\n\"url\":\"doprava a platba\"}\n]"}]},{"description":"Zobrazení detailu jedné stránky.","method":"GET","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"}"}]},{"description":"Vložení nové stránky do databáze.","method":"POST","url":"/pages","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \"title\":\"Nákupní řád\"}"},"responses":[{"status":201,"headers":{"Location":"//api/v1/pages/nakupni-rad"},"body":""}]},{"description":"Editace jedné stránky v databázi.","method":"PUT","url":"/pages/{id}","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \n\"title\":\"Nákupní řád e-shopu\"}"},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Nákupní řád e-shopu\"}"}]},{"description":"Smazání stránky z databáze.","method":"DELETE","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":204,"headers":{},"body":""}]}]}]
+ {
+ "name": "Stranky",
+ "description": "",
+ "resources": [
+ {
+ "description": "Vrácení seznamu všech stránek.",
+ "method": "GET",
+ "url": "/pages",
+ "request": {
+ "headers": {},
+ "body": ""
+ },
+ "responses": [
+ {
+ "status": 200,
+ "headers": {
+ "Content-Type": "application/json"
+ },
+ "body": "[\n{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"},\n{\"id\":\"5098eaef0496600200000002\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Obchodní podmínky\",\n\"url\":\"obchodni-podminky\"},\n{\"id\":\"5098eaef0496600200000003\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Doprava a platba\",\n\"url\":\"doprava a platba\"}\n]"
+ }
+ ]
+ },
+ {
+ "description": "Zobrazení detailu jedné stránky.",
+ "method": "GET",
+ "url": "/pages/{id}",
+ "request": {
+ "headers": {},
+ "body": ""
+ },
+ "responses": [
+ {
+ "status": 200,
+ "headers": {
+ "Content-Type": "application/json"
+ },
+ "body": "{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"}"
+ }
+ ]
+ },
+ {
+ "description": "Vložení nové stránky do databáze.",
+ "method": "POST",
+ "url": "/pages",
+ "request": {
+ "headers": {
+ "Content-Type": "application/json"
+ },
+ "body": "{\"content\":\"Lorem ipsum set dolorem\", \"title\":\"Nákupní řád\"}"
+ },
+ "responses": [
+ {
+ "status": 201,
+ "headers": {
+ "Location": "//api/v1/pages/nakupni-rad"
+ },
+ "body": ""
+ }
+ ]
+ },
+ {
+ "description": "Editace jedné stránky v databázi.",
+ "method": "PUT",
+ "url": "/pages/{id}",
+ "request": {
+ "headers": {
+ "Content-Type": "application/json"
+ },
+ "body": "{\"content\":\"Lorem ipsum set dolorem\", \n\"title\":\"Nákupní řád e-shopu\"}"
+ },
+ "responses": [
+ {
+ "status": 200,
+ "headers": {
+ "Content-Type": "application/json"
+ },
+ "body": "{\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Nákupní řád e-shopu\"}"
+ }
+ ]
+ },
+ {
+ "description": "Smazání stránky z databáze.",
+ "method": "DELETE",
+ "url": "/pages/{id}",
+ "request": {
+ "headers": {},
+ "body": ""
+ },
+ "responses": [
+ {
+ "status": 204,
+ "headers": {},
+ "body": ""
+ }
+ ]
+ }
+ ]
+ }
+]
Please sign in to comment.
Something went wrong with that request. Please try again.