workarea-livechat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4f0b404b9ae0b9d4327e619268bd5b4f5a22d2e110d980c6298c436d39c65e98
4
+ data.tar.gz: 0f414d8094026b9a53ef7a73fb11225b890309e4c75f17a057dc2f17aec5824a
5
+ SHA512:
6
+ metadata.gz: c124a82d8cdae3c57b7ed3c38ec6aeac780433ef33d0221ab5ba0ce72315a05c53f52cbfef3847447aaab6abb79b5fe3e5850f86a941d3726285a31bf0ccf560
7
+ data.tar.gz: aac1d03d7b26b45e3e49ba6ab9d02cd3d65af68b854303601296d16225b6e21fded11f686b7c141837caac76cdcb64d4b2ef9ff140f54bd024051517abe28e63
@@ -0,0 +1,20 @@
1
+ Copyright 2020 Rocela Durazo
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Workarea Livechat
2
+ Livechat plugin for the Workarea platform.
3
+
4
+ This plugin supports injecting the livechat JS snippet on every storefront page.
5
+
6
+ See https://www.livechatinc.com for more information on the live chat platform.
7
+
8
+ ## Usage
9
+ First you need to create a [livechat account](https://accounts.livechat.com/signup) and get your licence number they will give you a free license for 14 days.
10
+
11
+ ## Installation
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'workarea-livechat'
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ ```bash
21
+ $ bundle install
22
+ ```
23
+
24
+ ## Configuration
25
+ You can configure under your [Admin dashboard configuration](http://localhost:3000/admin/configuration) search for LiveChat
26
+
27
+
28
+ ## License
29
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,31 @@
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 = 'Workarea3 Plugin'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+ load 'rails/tasks/statistics.rake'
20
+ load 'workarea/changelog.rake'
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+ task default: :test
@@ -0,0 +1,9 @@
1
+ - if Workarea::Livechat.enabled?
2
+ :javascript
3
+ window.__lc = window.__lc || {};
4
+ window.__lc.license = "#{Workarea::Livechat.license_number}";
5
+ ;(function(n,t,c){function i(n){return e._h?e._h.apply(null,n):e._q.push(n)}var e={_q:[],_h:null,_v:"2.0",on:function(){i(["on",c.call(arguments)])},once:function(){i(["once",c.call(arguments)])},off:function(){i(["off",c.call(arguments)])},get:function(){if(!e._h)throw new Error("[LiveChatWidget] You can't use getters before load.");return i(["get",c.call(arguments)])},call:function(){i(["call",c.call(arguments)])},init:function(){var n=t.createElement("script");n.async=!0,n.type="text/javascript",n.src="https://cdn.livechatinc.com/tracking.js",t.head.appendChild(n)}};!n.__lc.asyncInit&&e.init(),n.LiveChatWidget=n.LiveChatWidget||e}(window,document,[].slice))
6
+ %noscript
7
+ %a{:href => "https://www.livechatinc.com/chat-with/#{Workarea::Livechat.license_number}/", :rel => "nofollow"}> Chat with us
8
+ , powered by
9
+ %a{:href => "https://www.livechatinc.com/?welcome", :rel => "noopener nofollow", :target => "_blank"} LiveChat
@@ -0,0 +1,5 @@
1
+ Workarea.append_partials(
2
+ 'storefront.document_head',
3
+ 'workarea/storefront/livechat/livechat_javascript'
4
+ )
5
+
@@ -0,0 +1,15 @@
1
+ Workarea::Configuration.define_fields do
2
+ fieldset 'LiveChat', namespaced: true do
3
+ field 'Enabled',
4
+ id: :enabled,
5
+ type: :boolean,
6
+ description: 'Whether to enable LiveChat functionality throughout the site',
7
+ default: true
8
+
9
+ field 'License Number',
10
+ id: :license_number,
11
+ type: :string,
12
+ description: 'Licence number for your app',
13
+ allow_blank: true
14
+ end
15
+ end
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :workarea_livechat do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,15 @@
1
+ require 'workarea'
2
+ require 'workarea/livechat/engine'
3
+ require 'workarea/livechat/version'
4
+
5
+ module Workarea
6
+ module Livechat
7
+ def self.license_number
8
+ Workarea.config.livechat_license_number
9
+ end
10
+
11
+ def self.enabled?
12
+ Workarea.config.livechat_enabled && license_number.present?
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ module Workarea
2
+ module Livechat
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ module Livechat
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-livechat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rocela Durazo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: workarea
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.x
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.x
27
+ description: Installs chat window onto all store front pages
28
+ email:
29
+ - roxdurazo@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.md
36
+ - Rakefile
37
+ - app/assets/config/workarea_livechat_manifest.js
38
+ - app/views/workarea/storefront/livechat/_livechat_javascript.html.haml
39
+ - config/initializers/appends.rb
40
+ - config/initializers/configuration.rb
41
+ - config/routes.rb
42
+ - lib/tasks/workarea_livechat_tasks.rake
43
+ - lib/workarea/livechat.rb
44
+ - lib/workarea/livechat/engine.rb
45
+ - lib/workarea/livechat/version.rb
46
+ homepage: https://github.com/roseliux/workarea-livechat
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubygems_version: 3.0.3
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: Install live chat onto storefront
69
+ test_files: []