From d70037e31737713eb8c50013723a9f85c0fb00e5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 30 Mar 2016 15:07:54 -0400 Subject: cmd-s to save --- examples/db.json | 9 ++++++++- themes/okadmin/public/js/app.js | 7 +++++++ themes/okadmin/templates/partials/inputs.liquid | 4 ++-- themes/okadmin/templates/resource.liquid | 2 +- themes/okadmin/templates/resource_new.liquid | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/examples/db.json b/examples/db.json index b9de44b..c370864 100644 --- a/examples/db.json +++ b/examples/db.json @@ -12,6 +12,10 @@ "uri": "cool", "caption": "cool" }, + { + "uri": "https://ltho.s3.amazonaws.com/013781df-a926-409b-ab2a-b7b2becf99fa.png", + "caption": "" + }, { "uri": "https://ltho.s3.amazonaws.com/5f4c3351-9434-446a-883b-aa4bffce8da3.png", "caption": "errrr" @@ -21,10 +25,13 @@ "url": "", "type": "", "token": "", + "width": "", + "height": "", "title": "", "thumb": "" }, - "__index": 0 + "__index": "0", + "dateCreated": "" }, { "type": "bagel", diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index 61fc8c8..e7f902d 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -284,6 +284,13 @@ var OKAdmin = function(){ $input.val(JSON.stringify(parsed)); }) }); + + $(window).on('keydown', function(e){ + if ( (e.ctrlKey || e.altKey || e.metaKey) && e.keyCode == 83 ) { + e.preventDefault() + $("#resource_form").submit() + } + }) } $(function(){ diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid index ba4459c..fa03e48 100644 --- a/themes/okadmin/templates/partials/inputs.liquid +++ b/themes/okadmin/templates/partials/inputs.liquid @@ -214,8 +214,8 @@ {% else %}
  • - - + + {{image.caption | strip_html}} diff --git a/themes/okadmin/templates/resource.liquid b/themes/okadmin/templates/resource.liquid index 9454123..88f93bd 100644 --- a/themes/okadmin/templates/resource.liquid +++ b/themes/okadmin/templates/resource.liquid @@ -10,7 +10,7 @@

    EDIT {{ resource.type }} '{{ resource.spec.title.value }}'

    -
    + {% include 'partials/inputs' %} diff --git a/themes/okadmin/templates/resource_new.liquid b/themes/okadmin/templates/resource_new.liquid index d059445..15d13ba 100644 --- a/themes/okadmin/templates/resource_new.liquid +++ b/themes/okadmin/templates/resource_new.liquid @@ -8,7 +8,7 @@

    NEW {{ resource.type }}

    - + {% include 'partials/inputs' %} -- cgit v1.2.3-70-g09d2