scrivito_qzzr_widget 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +21 -0
- data/app/assets/images/widgets/scrivito_qzzr_widget.png +0 -0
- data/app/assets/javascripts/scrivito_qzzr_widget/application.js +1 -0
- data/app/assets/javascripts/scrivito_qzzr_widget/editing.js +27 -0
- data/app/assets/javascripts/scrivito_qzzr_widget/init.js +8 -0
- data/app/assets/javascripts/scrivito_qzzr_widget.js +1 -0
- data/app/assets/stylesheets/scrivito_qzzr_widget.css +10 -0
- data/app/models/qzzr_widget.rb +12 -0
- data/app/views/qzzr_widget/details.html.erb +13 -0
- data/app/views/qzzr_widget/show.html.erb +7 -0
- data/app/views/qzzr_widget/thumbnail.html.erb +3 -0
- data/lib/scrivito_qzzr_widget/engine.rb +5 -0
- data/lib/scrivito_qzzr_widget/version.rb +3 -0
- data/lib/scrivito_qzzr_widget.rb +4 -0
- data/lib/tasks/scrivito_qzzr_widget_tasks.rake +4 -0
- data/scrivito/migrate/0_create_qzzr_widget.rb +14 -0
- metadata +72 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ba42d4ca34f59c4853b03862f9a3cd421130c802
|
4
|
+
data.tar.gz: be553973c257cde459c7069b493966030d2a7ee7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 62df7d187e93c99c8bced4da7064a9e802523b798ba835e57e413889880f1563a0ac25fd95410dbaf10d8c4879a93e0d3a3f0372f0c3d40e5ef03e7df297f376
|
7
|
+
data.tar.gz: c036261881b76889638fc2ab2619adc54ac0526bc9fac58e5c75a5b8b12edd63c309655c05f468a787e5691d10cdfb16434bb1df202f800b05e81795da4b705f
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ScrivitoQzzrWidget'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
// alert('Loaded application.js')
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// alert('Loaded editing.js')
|
2
|
+
|
3
|
+
// (function($, App) {
|
4
|
+
// 'use strict';
|
5
|
+
//
|
6
|
+
// var TextAreaEditor = {
|
7
|
+
// init_function: function(scrivito_tag) {
|
8
|
+
// $(scrivito_tag).on('keyup', function() {
|
9
|
+
// $(scrivito_tag).scrivito('save', scrivito_tag.value);
|
10
|
+
// });
|
11
|
+
// }
|
12
|
+
// };
|
13
|
+
//
|
14
|
+
// scrivito.on('content', function() {
|
15
|
+
// if(scrivito.in_editable_view()) {
|
16
|
+
// scrivito.define_editor("text_area_editor", {
|
17
|
+
// can_edit: function(element) {
|
18
|
+
// return $(element).is('textarea.form-control');
|
19
|
+
// },
|
20
|
+
// activate: function(element) {
|
21
|
+
// TextAreaEditor.init_function(element);
|
22
|
+
// }
|
23
|
+
// });
|
24
|
+
// }
|
25
|
+
// });
|
26
|
+
//
|
27
|
+
// })(jQuery, this);
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree ./scrivito_qzzr_widget
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*
|
2
|
+
.hljs{display:block;overflow-x:auto;padding:0.5em;background:#23241f;-webkit-text-size-adjust:none}.hljs,.hljs-tag,.css .hljs-rules,.css .hljs-value,.css .hljs-function .hljs-preprocessor,.hljs-pragma{color:#f8f8f2}.hljs-strongemphasis,.hljs-strong,.hljs-emphasis{color:#a8a8a2}.hljs-bullet,.hljs-blockquote,.hljs-horizontal_rule,.hljs-number,.hljs-regexp,.alias .hljs-keyword,.hljs-literal,.hljs-hexcolor{color:#ae81ff}.hljs-tag .hljs-value,.hljs-code,.hljs-title,.css .hljs-class,.hljs-class .hljs-title:last-child{color:#a6e22e}.hljs-link_url{font-size:80%}.hljs-strong,.hljs-strongemphasis{font-weight:bold}.hljs-emphasis,.hljs-strongemphasis,.hljs-class .hljs-title:last-child{font-style:italic}.hljs-keyword,.hljs-function,.hljs-change,.hljs-winutils,.hljs-flow,.nginx .hljs-title,.tex .hljs-special,.hljs-header,.hljs-attribute,.hljs-symbol,.hljs-symbol .hljs-string,.hljs-tag .hljs-title,.hljs-value,.alias .hljs-keyword:first-child,.css .hljs-tag,.css .unit,.css .hljs-important{color:#f92672}.hljs-function .hljs-keyword,.hljs-class .hljs-keyword:first-child,.hljs-constant,.css .hljs-attribute{color:#66d9ef}.hljs-variable,.hljs-params,.hljs-class .hljs-title{color:#f8f8f2}.hljs-string,.css .hljs-id,.hljs-subst,.hljs-type,.ruby .hljs-class .hljs-parent,.hljs-built_in,.django .hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.django .hljs-filter .hljs-argument,.smalltalk .hljs-localvars,.smalltalk .hljs-array,.hljs-attr_selector,.hljs-pseudo,.hljs-addition,.hljs-stream,.hljs-envvar,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.hljs-prompt,.hljs-link_label,.hljs-link_url{color:#e6db74}.hljs-comment,.hljs-javadoc,.hljs-annotation,.hljs-decorator,.hljs-template_comment,.hljs-pi,.hljs-doctype,.hljs-deletion,.hljs-shebang,.apache .hljs-sqbracket,.tex .hljs-formula{color:#75715e}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata,.xml .php,.php .xml{opacity:0.5}
|
3
|
+
|
4
|
+
pre.highlightjs {
|
5
|
+
background-color: transparent;
|
6
|
+
border: none;
|
7
|
+
padding: 0;
|
8
|
+
margin: 0;
|
9
|
+
}
|
10
|
+
*/
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class QzzrWidget < Widget
|
2
|
+
attribute :title, :string
|
3
|
+
attribute :quiz_id, :string
|
4
|
+
|
5
|
+
DEFAULT_THEME = "default"
|
6
|
+
|
7
|
+
# def url_to_theme
|
8
|
+
# theme = widget.theme.blank? ? DEFAULT_THEME : widget.theme
|
9
|
+
# "//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/#{theme}.min.css"
|
10
|
+
# end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= scrivito_details_for t('scrivito_qzzr_widget.details.title') do %>
|
2
|
+
<p>Title:</p>
|
3
|
+
<%= scrivito_tag(:div, widget, :title, data: {
|
4
|
+
scrivito_editors_multiline: false
|
5
|
+
}) %>
|
6
|
+
<% end %>
|
7
|
+
<br>
|
8
|
+
<%= scrivito_details_for t('scrivito_qzzr_widget.details.quiz_id', default: 'Quiz id') do %>
|
9
|
+
<p>Quiz id:</p>
|
10
|
+
<%= scrivito_tag(:div, widget, :quiz_id, data: {
|
11
|
+
scrivito_editors_multiline: false
|
12
|
+
}) %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateQzzrWidget < ::Scrivito::Migration
|
2
|
+
def up
|
3
|
+
Scrivito::ObjClass.create(
|
4
|
+
name: 'QzzrWidget',
|
5
|
+
type: 'publication',
|
6
|
+
is_binary: false,
|
7
|
+
title: 'Qzzr Widget',
|
8
|
+
attributes: [
|
9
|
+
{name: "title", type: "string"},
|
10
|
+
{name: "quiz_id", type: "string"}
|
11
|
+
]
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scrivito_qzzr_widget
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Converge Industries
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: scrivito
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Scrivito Widget for embedded Qzzer quizzes
|
28
|
+
email:
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- Rakefile
|
34
|
+
- app/assets/images/widgets/scrivito_qzzr_widget.png
|
35
|
+
- app/assets/javascripts/scrivito_qzzr_widget.js
|
36
|
+
- app/assets/javascripts/scrivito_qzzr_widget/application.js
|
37
|
+
- app/assets/javascripts/scrivito_qzzr_widget/editing.js
|
38
|
+
- app/assets/javascripts/scrivito_qzzr_widget/init.js
|
39
|
+
- app/assets/stylesheets/scrivito_qzzr_widget.css
|
40
|
+
- app/models/qzzr_widget.rb
|
41
|
+
- app/views/qzzr_widget/details.html.erb
|
42
|
+
- app/views/qzzr_widget/show.html.erb
|
43
|
+
- app/views/qzzr_widget/thumbnail.html.erb
|
44
|
+
- lib/scrivito_qzzr_widget.rb
|
45
|
+
- lib/scrivito_qzzr_widget/engine.rb
|
46
|
+
- lib/scrivito_qzzr_widget/version.rb
|
47
|
+
- lib/tasks/scrivito_qzzr_widget_tasks.rake
|
48
|
+
- scrivito/migrate/0_create_qzzr_widget.rb
|
49
|
+
homepage:
|
50
|
+
licenses: []
|
51
|
+
metadata: {}
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 2.6.12
|
69
|
+
signing_key:
|
70
|
+
specification_version: 4
|
71
|
+
summary: Scrivito Widget for embedded Qzzer quizzes
|
72
|
+
test_files: []
|