diff --git a/classes/WhatDidTheySayAdmin.inc b/classes/WhatDidTheySayAdmin.inc index f99f67e..a36dc94 100644 --- a/classes/WhatDidTheySayAdmin.inc +++ b/classes/WhatDidTheySayAdmin.inc @@ -103,10 +103,12 @@ class WhatDidTheySayAdmin { } if ($filter_to_use) { - $target = $this->get_filters_dir() . '/' . preg_replace('#[^a-z0-9_-]#', '', strtolower($filter_to_use)); - if (is_dir($target)) { - $this->override_filter_info = array(); - foreach (glob($target . '/*') as $file) { + $all_filters = $this->_get_available_override_filters(); + + $filter_to_use = preg_replace('#[^a-z0-9_-]#', '', strtolower($filter_to_use)); + + if (isset($all_filters[$filter_to_use])) { + foreach (glob($all_filters[$filter_to_use] . '/*') as $file) { if (preg_match('#\.(php|inc)$#', $file) > 0) { $this->override_filter_info['php'] = $file; } if (preg_match('#\.(css)$#', $file) > 0) { $this->override_filter_info['css'] = $file; } } @@ -864,19 +866,27 @@ class WhatDidTheySayAdmin { function _get_available_override_filters() { $available_filters = array(); - if (is_dir($this->get_filters_dir())) { - foreach (glob($this->get_filters_dir() . '/*') as $dir) { - if (is_dir($dir)) { - if (basename($dir) == preg_replace('#[^a-z0-9_-]#', '', strtolower(basename($dir)))) { - foreach (glob($dir . '/*') as $file) { - if (preg_match('#^(.*)\.(inc|php)$#', basename($file), $matches) > 0) { - $available_filters[] = basename($dir); + $search_path = array( + realpath(dirname(__FILE__) . '/../transcript-filters'), + $this->get_filters_dir() + ); + + foreach ($search_path as $target) { + if (is_dir($target)) { + foreach (glob($target . '/*') as $dir) { + if (is_dir($dir)) { + if (basename($dir) == preg_replace('#[^a-z0-9_-]#', '', strtolower(basename($dir)))) { + foreach (glob($dir . '/*') as $file) { + if (preg_match('#^(.*)\.(inc|php)$#', basename($file), $matches) > 0) { + $available_filters[basename($dir)] = $dir; + } } } } } } } + return $available_filters; } diff --git a/classes/partials/_default-styles.inc b/classes/partials/_default-styles.inc index 8259109..4710bf8 100644 --- a/classes/partials/_default-styles.inc +++ b/classes/partials/_default-styles.inc @@ -69,14 +69,17 @@ +
+ +diff --git a/classes/partials/admin.inc b/classes/partials/admin.inc index a901f4a..907334a 100644 --- a/classes/partials/admin.inc +++ b/classes/partials/admin.inc @@ -107,6 +107,10 @@ }; $('wdts-filters-to-use').observe('change', load_sample_transcript); + $('refresh-filter-preview').observe('click', function(e) { + Event.stop(e); + load_sample_transcript(); + }); Event.observe(window, 'load', load_sample_transcript); diff --git a/graphics/view-refresh.png b/graphics/view-refresh.png new file mode 100644 index 0000000..3fd71d6 Binary files /dev/null and b/graphics/view-refresh.png differ diff --git a/transcript-filters/left-justified-basic/LeftJustifiedBasic.css b/transcript-filters/left-justified-basic/LeftJustifiedBasic.css new file mode 100644 index 0000000..547969c --- /dev/null +++ b/transcript-filters/left-justified-basic/LeftJustifiedBasic.css @@ -0,0 +1,40 @@ +div.wdts-transcript { + border: solid #333 1px; + padding: 0.5em; + margin: 0.5em; + background-color: #C6D9E9 +} + +div.wdts-transcript div, div.wdts-transcript span { + font-family: inherit +} + +div.wdts-transcript div.wdts-scene-heading { + text-transform: uppercase; + text-align: inherit; +} + +div.wdts-transcript div.wdts-dialog { + text-align: inherit +} + +div.wdts-transcript div.wdts-dialog span { + display: inline +} + +div.wdts-transcript div.wdts-dialog span.wdts-name { + text-transform: inherit; + font-weight: bold +} + +div.wdts-transcript div.wdts-dialog span.wdts-speech { + margin: 0 +} + +div.wdts-transcript div.wdts-dialog span.wdts-direction { + font-style: italic +} + +.wdts-transcript-opener { + margin: 0.5em 0; +} \ No newline at end of file diff --git a/transcript-filters/left-justified-basic/LeftJustifiedBasic.inc b/transcript-filters/left-justified-basic/LeftJustifiedBasic.inc new file mode 100644 index 0000000..f2d9994 --- /dev/null +++ b/transcript-filters/left-justified-basic/LeftJustifiedBasic.inc @@ -0,0 +1,18 @@ +' . $name . ''; + if (!empty($direction)) { + $content .= ' ' . $direction . ''; + } + $content .= ': ' . $speech . ''; + + return array($name, $direction, $speech, $content); + } +} + +?> \ No newline at end of file