-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from matthewjackowski/devel
Cleaning up the codebase
- Loading branch information
Showing
17 changed files
with
195 additions
and
90 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 |
---|---|---|
|
@@ -8,4 +8,5 @@ tests/_output/* | |
tests/_support/* | ||
|
||
languages/ | ||
build/ | ||
tests/_output/* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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 |
---|---|---|
@@ -1,22 +1,41 @@ | ||
<?php | ||
/** | ||
* Includes Transifex Live javascript snippet | ||
* @package TransifexLiveIntegration | ||
*/ | ||
|
||
/** | ||
* Class that creates javascript snippet based on settings | ||
*/ | ||
class Transifex_Live_Integration_Javascript { | ||
|
||
/** | ||
* Stores current plugin settings. | ||
* @var array | ||
*/ | ||
private $live_settings = array(); | ||
|
||
/** | ||
* Public constructor, sets local settings | ||
* @param array $live_settings Associative array of plugin settings. | ||
*/ | ||
public function __construct( $live_settings ) { | ||
Plugin_Debug::logTrace(); | ||
$this->live_settings = $live_settings; | ||
} | ||
|
||
/** | ||
* Renders javascript includes in the page | ||
*/ | ||
function render() { | ||
Plugin_Debug::logTrace(); | ||
$live_settings_string = json_encode( $this->live_settings ); | ||
Plugin_Debug::logTrace( $live_settings_string ); | ||
echo <<<LIVE | ||
$include = <<<LIVE | ||
<script type="text/javascript">window.liveSettings=$live_settings_string;</script> | ||
<script type="text/javascript" src="//cdn.transifex.com/live.js"></script> | ||
LIVE; | ||
echo $include; | ||
} | ||
|
||
} |
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
Oops, something went wrong.