scrivito_highlightjs_widget 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9cad1e01dcc87d57960159ddace2f63ca5d9fff
4
- data.tar.gz: cfce491a11f85c2d8a0ce7b3d44ab30dff6be49f
3
+ metadata.gz: 1bced7243e33b159af8cfa8286b9ca251a5f96cc
4
+ data.tar.gz: 84d0aed7dc248f2f1090336bfcb3f010776546a4
5
5
  SHA512:
6
- metadata.gz: 23aa4a1146c0998cec6a1428b6f2841c72af129e9e91850d3f7bd0ac7bfeb7c2fd1b62de289723aadf2fe3eb6098e39f4ad6a64589c84a566333b314b4cf30d5
7
- data.tar.gz: 7edc7cc62efa0db871c42d919e1d02ae8cf57a8b95a7fa0b04a509122aeccb8f04c72495b1b44adb73ac7822ecfa71a97a3a9711fa14eb0fec42614a2214bc58
6
+ metadata.gz: 9ce283ecff1dd4397e74137c1cf6b4f884d21ec5f3d081e4e9f007b7171e682eaf281565ab2a5bbc8dbc5b99ded06f1d6680b46b6f0793d905bc5877ecfc1005
7
+ data.tar.gz: 708a4f088f29bddee9d3164205da0ed1ea520bc0239a9ae02d64fc565f57e1a007d4fa1896b487f0e54c54be02b6b704611c847959798fc5d6b82030f0d98e34
@@ -1,25 +1,25 @@
1
1
  (function($, App) {
2
2
  'use strict';
3
3
 
4
- $(function() {
5
-
6
- App.textfieldEditor = {
7
- // set selector for Editor
8
- selector: '[data-editor=textfield-editor]',
9
-
10
- blurFunction: function(cmsField) {
11
- var text = cmsField.val();
12
- return cmsField.scrivito('save', text);
13
- }
14
- };
4
+ var TextAreaEditor = {
5
+ init_function: function(scrivito_tag) {
6
+ $(scrivito_tag).on('keyup', function() {
7
+ $(scrivito_tag).scrivito('save', scrivito_tag.value);
8
+ });
9
+ }
10
+ };
15
11
 
16
- scrivito.on('load', function() {
17
- return $('body').on('blur', textfieldEditor.selector, function(event) {
18
- if(scrivito.in_editable_view()) {
19
- textfieldEditor.blurFunction($(event.target));
12
+ scrivito.on('content', function() {
13
+ if(scrivito.in_editable_view()) {
14
+ scrivito.define_editor("text_area_editor", {
15
+ can_edit: function(element) {
16
+ return $(element).is('textarea.form-control');
17
+ },
18
+ activate: function(element) {
19
+ TextAreaEditor.init_function(element);
20
20
  }
21
21
  });
22
- });
22
+ }
23
23
  });
24
24
 
25
25
  })(jQuery, this);
@@ -1,15 +1,15 @@
1
- <%= scrivito_details_for 'Code' do %>
1
+ <%= scrivito_details_for t('scrivito_highlightjs_widget.details.code', default: 'Code') do %>
2
2
  <pre class="highlightjs">
3
- <%= scrivito_tag(:textarea, widget, :code, data: {editor: "textfield-editor"}, style: "width:100%;height:168px;") %>
3
+ <%= scrivito_tag(:textarea, widget, :code, class: 'form-control', rows: 5) %>
4
4
  </pre>
5
5
  <% end %>
6
6
 
7
- <%= scrivito_details_for 'Language' do %>
7
+ <%= scrivito_details_for t('scrivito_highlightjs_widget.details.language', default: 'Language') do %>
8
8
  <div class="alert alert-info">
9
- If automatic language detection does not work for you.
10
- <p>
11
- Enter <strong>nohighlight</strong> if no highlighting needed.
12
- </p>
9
+ <%= t('scrivito_highlightjs_widget.thumbnail.hint', default: 'If the automatic code highlighting does not work for you.') %>
10
+ </div>
11
+ <div class="alert alert-info">
12
+ <%= t('scrivito_highlightjs_widget.thumbnail.no_highlight', default: 'Enter nohighligh if no highlighting needed.') %>
13
13
  </div>
14
14
  <%= scrivito_tag(:div, widget, :language) %>
15
15
  <% end %>
@@ -1,3 +1,3 @@
1
- <%= scrivito_thumbnail 'Syntax Highlighter', image_tag("highlight.png") do %>
2
- Highlight your Source Code.
1
+ <%= scrivito_thumbnail t('scrivito_highlightjs_widget.thumbnail.title', default: 'Syntx Highlighter'), image_tag("highlight.png") do %>
2
+ <%= t('scrivito_highlightjs_widget.thumbnail.description', default: 'Highlight your Source Code') %>
3
3
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoHighlightjsWidget
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_highlightjs_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scrivito