summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-03-30 15:07:54 -0400
committerJules Laplace <jules@okfoc.us>2016-03-30 15:07:54 -0400
commitd70037e31737713eb8c50013723a9f85c0fb00e5 (patch)
tree32680c72842815c9011bb39d2f7bbc91ea4bfa54 /themes
parent3062f3541d2579a5c313286e6d5cc1400e1c6500 (diff)
cmd-s to save
Diffstat (limited to 'themes')
-rw-r--r--themes/okadmin/public/js/app.js7
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid4
-rw-r--r--themes/okadmin/templates/resource.liquid2
-rw-r--r--themes/okadmin/templates/resource_new.liquid2
4 files changed, 11 insertions, 4 deletions
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 %}
<li class="image-element">
<label>Caption</label>
- <input type="hidden" name="{{name}}[{{forloop.index0}}][uri]" value="{{image.uri}}">
- <textarea class="caption" name="{{name}}[{{forloop.index0}}][caption]">{{image.caption}}</textarea>
+ <input type="hidden" name="{{name}}[][uri]" value="{{image.uri}}">
+ <textarea class="caption" name="{{name}}[][caption]">{{image.caption}}</textarea>
<input type="hidden" name="{{name}}[][type]" value="image">
<img src="{{image.uri}}" alt="{{image.caption | strip_html}}">
<button class="remove">x</button>
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 @@
<section class="resource main" data-type="{{ resource.type }}" data-id="{{ resource.id }}">
<h2>EDIT {{ resource.type }} '{{ resource.spec.title.value }}'</h2>
- <form action="." method="POST">
+ <form action="." method="POST" id="resource_form">
<input type="hidden" name="_method" value="PUT">
{% include 'partials/inputs' %}
<label>&nbsp;</label><button type="submit">Save</button>
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 @@
<section class="main resource resource-new">
<h2>NEW {{ resource.type }}</h2>
- <form action=".." method="POST">
+ <form action=".." method="POST" id="resource_form">
<input type="hidden" name="_method" value="POST">
{% include 'partials/inputs' %}
<label>&nbsp;</label><button type="submit">Create</button>