-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dainis Tillers
committed
Nov 19, 2014
0 parents
commit b44b95b
Showing
55 changed files
with
3,218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tmp-build | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Harjinderkour
|
||
pkg_tawk_UNZIPFIRST.zip |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
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. | ||
|
||
Create your tawk.to account -> https://tawk.to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
cd v2 | ||
|
||
./build.sh | ||
|
||
cd ../v3 | ||
|
||
./build.sh | ||
|
||
cd ../ | ||
|
||
mkdir tmp-build | ||
|
||
cd tmp-build | ||
|
||
cp ../v2/pkg_tawk.zip pkg_tawk_joomla2.x.zip | ||
cp ../v3/pkg_tawk.zip pkg_tawk_joomla3.x.zip | ||
|
||
cp ../LICENCE.txt ./ | ||
cp ../README ./ | ||
|
||
zip -1 pkg_tawk_UNZIPFIRST.zip -r LICENCE.txt README pkg_tawk_joomla2.x.zip pkg_tawk_joomla3.x.zip | ||
|
||
cp pkg_tawk_UNZIPFIRST.zip ../ | ||
|
||
cd ../ | ||
|
||
rm -r tmp-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><title></title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tmp-build | ||
pkg_tawk.zip |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
mkdir tmp-build | ||
|
||
cd tmp-build | ||
|
||
mkdir packages | ||
|
||
cp ../pkg_tawk.xml ./ | ||
cp ../LICENCE.txt ./ | ||
cp -R ../plugin ./ | ||
cp -R ../component ./ | ||
|
||
cd component | ||
zip -1 ../com_tawkwidget.zip -r ./* | ||
|
||
cd ../plugin | ||
zip -1 ../plg_tawkwidget.zip -r ./* | ||
|
||
cd ../ | ||
|
||
mv com_tawkwidget.zip packages | ||
mv plg_tawkwidget.zip packages | ||
|
||
zip -1 pkg_tawk.zip -r ./packages pkg_tawk.xml LICENCE.txt | ||
|
||
cp pkg_tawk.zip ../ | ||
|
||
cd ../ | ||
|
||
rm -r tmp-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
// import Joomla controller library | ||
jimport('joomla.application.component.controller'); | ||
|
||
class TawkWidgetController extends JController { | ||
|
||
function display($cachable = false, $urlparams = false) { | ||
|
||
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true)); | ||
|
||
$widget = $model->getWidget(); | ||
|
||
// set default view if not set | ||
$input = JFactory::getApplication()->input; | ||
$input->set('view', $input->getCmd('view', 'tawkwidget')); | ||
|
||
// call parent behavior | ||
parent::display(false); | ||
} | ||
|
||
function setwidget() { | ||
header('Content-Type: application/json'); | ||
|
||
if(!isset($_POST['pageId']) || !isset($_POST['widgetId'])) { | ||
echo json_encode(array("success" => FALSE)); | ||
die(); | ||
} | ||
|
||
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true)); | ||
|
||
$model->setWidget($_POST['pageId'], $_POST['widgetId']); | ||
|
||
echo json_encode(array("success" => TRUE)); | ||
die(); | ||
} | ||
|
||
function removewidget() { | ||
header('Content-Type: application/json'); | ||
|
||
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true)); | ||
|
||
$model->removeWidget(); | ||
|
||
echo json_encode(array("success" => TRUE)); | ||
die(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><title></title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
COM_TAWKWIDGET_MENU="Tawk.to widget" | ||
COM_TAWKWIDGET="Tawk.to" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
COM_TAWKWIDGET_MENU="Tawk.to widget" | ||
COM_TAWKWIDGET="Tawk.to" |
2 changes: 2 additions & 0 deletions
2
v2/component/admin/language/en-GB/en-GB.com_tawkwidget.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
COM_TAWKWIDGET_MENU="Tawk.to widget" | ||
COM_TAWKWIDGET="Tawk.to" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
// import Joomla modelitem library | ||
jimport('joomla.application.component.modelitem'); | ||
|
||
class TawkWidgetModelTawkWidget extends JModelItem { | ||
protected $widget; | ||
|
||
public function getTable($type = 'TawkWidget', $prefix = 'TawkWidgetTable', $config = array()) { | ||
return JTable::getInstance($type, $prefix, $config); | ||
} | ||
|
||
public function getWidget() { | ||
if(isset($this->widget)) { | ||
return $this->widget; | ||
} | ||
|
||
$this->widget = $this->getTable(); | ||
$this->widget->load(1); | ||
|
||
return $this->widget; | ||
} | ||
|
||
public function setWidget($pageId, $widgetId) { | ||
$obj = new stdClass(); | ||
|
||
$obj->id = 1; | ||
$obj->widget_id = $widgetId; | ||
$obj->page_id = $pageId; | ||
|
||
if($this->getWidget()->id !== null) { | ||
JFactory::getDbo()->updateObject('#__tawkwidget', $obj, 'id'); | ||
} else { | ||
JFactory::getDbo()->insertObject('#__tawkwidget', $obj); | ||
} | ||
} | ||
|
||
public function removeWidget() { | ||
$this->getTable()->delete(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- | ||
-- @package Tawk.to Widget for Joomla! 2.5 | ||
-- @author Tawk.to | ||
-- @copyright (C) 2014- Tawk.to | ||
-- @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
-- | ||
|
||
|
||
DROP TABLE IF EXISTS `#__tawkwidget`; | ||
|
||
CREATE TABLE `#__tawkwidget` ( | ||
`id` int(10) NOT NULL, | ||
`page_id` varchar(50), | ||
`widget_id` varchar(50), | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE IF EXISTS `#__tawkwidget`; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
// No direct access | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
// import Joomla table library | ||
jimport('joomla.database.table'); | ||
|
||
|
||
class TawkWidgetTableTawkWidget extends JTable { | ||
function __construct(&$db) { | ||
parent::__construct('#__tawkwidget', 'id', $db); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
jimport('joomla.application.component.controller'); | ||
|
||
$controller = JController::getInstance('TawkWidget'); | ||
|
||
$task = JFactory::getApplication()->input->getCmd('task'); | ||
|
||
$controller->execute($task); | ||
|
||
$controller->redirect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted Access'); | ||
|
||
// load tooltip behavior | ||
JHtml::_('behavior.tooltip'); | ||
?> | ||
|
||
<script type="text/javascript" src="<?php echo $this->getBaseUrl() ?>/public/js/jquery-1.11.0.min.js"></script> | ||
|
||
<iframe | ||
id="tawkIframe" | ||
src="" | ||
style="min-height: 300px; width : 100%; border: none"> | ||
</iframe> | ||
|
||
<script type="text/javascript"> | ||
var currentHost = window.location.protocol + "//" + window.location.host; | ||
var url = "<?php echo $this->getIframeUrl() ?>&parentDomain=" + currentHost; | ||
|
||
jQuery('#tawkIframe').attr('src', url); | ||
|
||
var iframe = jQuery('#tawk_widget_customization')[0]; | ||
|
||
window.addEventListener('message', function(e) { | ||
|
||
if(e.origin === '<?php echo $this->getBaseUrl() ?>') { | ||
|
||
if(e.data.action === 'setWidget') { | ||
setWidget(e); | ||
} | ||
|
||
if(e.data.action === 'removeWidget') { | ||
removeWidget(e); | ||
} | ||
} | ||
}); | ||
|
||
function setWidget(e) { | ||
jQuery.post('index.php?option=com_tawkwidget&task=setwidget', { | ||
pageId : e.data.pageId, | ||
widgetId : e.data.widgetId | ||
}, function(r) { | ||
if(r.success) { | ||
e.source.postMessage({action: 'setDone'}, '<?php echo $this->getBaseUrl() ?>'); | ||
} else { | ||
e.source.postMessage({action: 'setFail'}, '<?php echo $this->getBaseUrl() ?>'); | ||
} | ||
}); | ||
} | ||
|
||
function removeWidget(e) { | ||
jQuery.post('index.php?option=com_tawkwidget&task=removewidget', function(r) { | ||
if(r.success) { | ||
e.source.postMessage({action: 'removeDone'}, '<?php echo $this->getBaseUrl() ?>'); | ||
} else { | ||
e.source.postMessage({action: 'removeFail'}, '<?php echo $this->getBaseUrl() ?>'); | ||
} | ||
|
||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* @package Tawk.to Widget for Joomla! 2.5 | ||
* @author Tawk.to | ||
* @copyright (C) 2014- Tawk.to | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
**/ | ||
|
||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
// import Joomla view library | ||
jimport('joomla.application.component.view'); | ||
|
||
/** | ||
* HelloWorlds View | ||
*/ | ||
class TawkWidgetViewTawkWidget extends JView { | ||
/** | ||
* HelloWorlds view display method | ||
* @return void | ||
*/ | ||
function display($tpl = null) { | ||
$this->addToolBar(); | ||
parent::display($tpl); | ||
} | ||
|
||
public function getBaseUrl() { | ||
return 'https://plugins.tawk.to'; | ||
} | ||
|
||
public function getIframeUrl() { | ||
$model = parent::getModel('TawkWidget', 'TawkWidgetModel', array('ignore_request' => true)); | ||
|
||
$widget = $model->getWidget(); | ||
|
||
return "https://plugins.tawk.to/generic/widgets" | ||
."?currentPageId=".$widget->page_id | ||
."¤tWidgetId=".$widget->widget_id; | ||
} | ||
|
||
protected function addToolBar() { | ||
JToolBarHelper::title('Tawk.to widget'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><title></title> |
Oops, something went wrong.
I'm really very excited to my request for a new one for the greatest way