Skip to content

Commit

Permalink
use 0-1 for on-off type
Browse files Browse the repository at this point in the history
  • Loading branch information
TomCafferty committed Apr 19, 2013
1 parent e55464f commit 24e39f1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions action.php
Expand Up @@ -102,9 +102,9 @@ function convert(&$event, $param) {
$wikihtml = '';
$metadata = p_get_metadata($ID, $key, false);
if (strpos($metadata, 'eventline_html') !== false) {
$wikihtml = 'on'; }
$wikihtml = 1; }
elseif (strpos($metadata, 'eventline_nohtml') !== false) {
$wikihtml = 'off'; }
$wikihtml = 0; }
else {
$wikihtml = $this->getConf('wikihtml'); }

Expand Down
7 changes: 3 additions & 4 deletions conf/default.php
Expand Up @@ -4,14 +4,13 @@
$conf['height'] = '300px';
$conf['mouse'] = 'default';
$conf['center'] = "January 1, 2000 00:00:00";
$conf['controls'] = 'on';
$conf['controls'] = 1;
$conf['bandPos'] = 'default';
$conf['detailPercent'] = '80%';
$conf['overPercent'] = '20%';
$conf['detailPixels'] = '100';
$conf['overPixels'] = '200';
$conf['detailInterval'] = 'DECADE';
$conf['overInterval'] = 'CENTURY';
$conf['hotzone'] = 'off';
$conf['wikihtml'] = 'off';
$conf['showlink'] = 'on';
$conf['wikihtml'] = 0;
$conf['showlink'] = 1;
2 changes: 1 addition & 1 deletion getXmlData.php
Expand Up @@ -41,7 +41,7 @@ function pullInXmlData ($dokuPageId, $wikihtml) {
// get rendered html
$html = $renderer->doc;

if ($wikihtml=='on')
if ($wikihtml==1)
$ret_html = xmlentities(htmlentities($html, ENT_COMPAT));
else
$ret_html = $html;
Expand Down
10 changes: 5 additions & 5 deletions syntax.php
Expand Up @@ -138,10 +138,10 @@ function render($mode, &$R, $data) {
else
$overInterval = $this->getConf('overInterval');

if (isset($data['hotzone']))
$hotzone = $data['hotzone'];
if (isset($data['hotzone']) && $data['hotzone']=='on')
$hotzone = 1;
else
$hotzone = $this->getConf('hotzone');
$hotzone = 0;

$hzStart = $data['hzStart'];
$hzStart2 = $data['hzStart2'];
Expand Down Expand Up @@ -170,11 +170,11 @@ function render($mode, &$R, $data) {
$info_perm = auth_quickaclcheck($dataFile);
$info_filepath = fullpath(wikiFN($dataFile));
$info_writable = (is_writable($info_filepath) && ($info_perm >= AUTH_EDIT));
if($info_writable || ($showlink=='on'))
if($info_writable || ($showlink==1))
$R->doc .='<div id="eventlineplugin__data"> Go to <a title="' . $dataFile .'" class="wikilink1" href="' . wl($dataFile) . '">'.$data['file'].'</a> data</div>';

// Add a div for timeline filter controls if selected
if ($controls=='on'){
if ($controls==1){
$R->doc .='<div class="eventlineplugin__controls" id="eventlineplugin__controls"></div>';
}

Expand Down
4 changes: 2 additions & 2 deletions timeline.js
Expand Up @@ -46,7 +46,7 @@ function onLoad() {

var eventSource = new Timeline.DefaultEventSource();

if (hotzone == 'on')
if (hotzone == 1)
var bandInfos = [
Timeline.createHotZoneBandInfo({
zones: [
Expand Down Expand Up @@ -138,7 +138,7 @@ function onLoad() {

tl = Timeline.create(document.getElementById("eventlineplugin__timeline"), bandInfos, Timeline.HORIZONTAL);
Timeline.loadXML(filepath, function(xml, url) { eventSource.loadXML(xml, url); });
if (controls=='on') setupFilterHighlightControls(document.getElementById("eventlineplugin__controls"), tl, [0,1], theme);
if (controls==1) setupFilterHighlightControls(document.getElementById("eventlineplugin__controls"), tl, [0,1], theme);
javascript:centerTimeline(center);
}

Expand Down

0 comments on commit 24e39f1

Please sign in to comment.