Skip to content

Commit b44b95b

Browse files
author
Dainis Tillers
committed
Init
0 parents  commit b44b95b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3218
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tmp-build
2+
pkg_tawk_UNZIPFIRST.zip

LICENCE.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Unzip the downloaded file and install the plugin using the Extensions -> Install/Uninstall menu. And then navigate to: Components -> Tawk.to widget. Selected tawk.to widget will be added to every page.
2+
3+
Create your tawk.to account -> https://tawk.to

build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
cd v2
4+
5+
./build.sh
6+
7+
cd ../v3
8+
9+
./build.sh
10+
11+
cd ../
12+
13+
mkdir tmp-build
14+
15+
cd tmp-build
16+
17+
cp ../v2/pkg_tawk.zip pkg_tawk_joomla2.x.zip
18+
cp ../v3/pkg_tawk.zip pkg_tawk_joomla3.x.zip
19+
20+
cp ../LICENCE.txt ./
21+
cp ../README ./
22+
23+
zip -1 pkg_tawk_UNZIPFIRST.zip -r LICENCE.txt README pkg_tawk_joomla2.x.zip pkg_tawk_joomla3.x.zip
24+
25+
cp pkg_tawk_UNZIPFIRST.zip ../
26+
27+
cd ../
28+
29+
rm -r tmp-build

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><title></title>

v2/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tmp-build
2+
pkg_tawk.zip

v2/LICENCE.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

v2/build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
mkdir tmp-build
4+
5+
cd tmp-build
6+
7+
mkdir packages
8+
9+
cp ../pkg_tawk.xml ./
10+
cp ../LICENCE.txt ./
11+
cp -R ../plugin ./
12+
cp -R ../component ./
13+
14+
cd component
15+
zip -1 ../com_tawkwidget.zip -r ./*
16+
17+
cd ../plugin
18+
zip -1 ../plg_tawkwidget.zip -r ./*
19+
20+
cd ../
21+
22+
mv com_tawkwidget.zip packages
23+
mv plg_tawkwidget.zip packages
24+
25+
zip -1 pkg_tawk.zip -r ./packages pkg_tawk.xml LICENCE.txt
26+
27+
cp pkg_tawk.zip ../
28+
29+
cd ../
30+
31+
rm -r tmp-build

v2/component/admin/controller.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
/**
4+
* @package Tawk.to Widget for Joomla! 2.5
5+
* @author Tawk.to
6+
* @copyright (C) 2014- Tawk.to
7+
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
8+
**/
9+
10+
// No direct access to this file
11+
defined('_JEXEC') or die('Restricted access');
12+
13+
// import Joomla controller library
14+
jimport('joomla.application.component.controller');
15+
16+
class TawkWidgetController extends JController {
17+
18+
function display($cachable = false, $urlparams = false) {
19+
20+
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true));
21+
22+
$widget = $model->getWidget();
23+
24+
// set default view if not set
25+
$input = JFactory::getApplication()->input;
26+
$input->set('view', $input->getCmd('view', 'tawkwidget'));
27+
28+
// call parent behavior
29+
parent::display(false);
30+
}
31+
32+
function setwidget() {
33+
header('Content-Type: application/json');
34+
35+
if(!isset($_POST['pageId']) || !isset($_POST['widgetId'])) {
36+
echo json_encode(array("success" => FALSE));
37+
die();
38+
}
39+
40+
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true));
41+
42+
$model->setWidget($_POST['pageId'], $_POST['widgetId']);
43+
44+
echo json_encode(array("success" => TRUE));
45+
die();
46+
}
47+
48+
function removewidget() {
49+
header('Content-Type: application/json');
50+
51+
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true));
52+
53+
$model->removeWidget();
54+
55+
echo json_encode(array("success" => TRUE));
56+
die();
57+
}
58+
}

v2/component/admin/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><title></title>

0 commit comments

Comments
 (0)