Add highlight behavior #371

Closed
wants to merge 23 commits into
from

Conversation

Projects
None yet
5 participants
Owner

mbabker commented Sep 18, 2011

This pull request extracts the highlight JHtml behavior and associated media from Finder for use in the platform.

Contributor

eddieajau commented Sep 20, 2011

Hi Michael. Is this to help with the Finder integration?

Owner

mbabker commented Sep 21, 2011

This one is in part to help with integrating Finder and additionally
making the highlight behavior available to other components without
needing to duplicate code. On the Finder repo, I've started working on
converting the system plugin that handled it previously into a content
plugin acting onContentPrepare which could be offered into the CMS before
Finder if completed and working OK.

On 9/21/11 2:32 AM, "Andrew Eddie"
reply@reply.github.com
wrote:

Hi Michael. Is this to help with the Finder integration?

Reply to this email directly or view it on GitHub:
#371 (comment)

jlover commented Nov 2, 2011

Checkstyle error details:
libraries/joomla/html/html/string.php:179
Concat operator must be surrounded by spaces
libraries/joomla/html/html/string.php:179
Concat operator must be surrounded by spaces

Contributor

joomla-jenkins commented Nov 10, 2011

Build triggered by changes to the base.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 233 warnings and 4165 errors.

Contributor

joomla-jenkins commented Nov 13, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1695 tests and 10608 assertions.
Checkstyle analysis reported 235 warnings and 2 errors.

Contributor

joomla-jenkins commented Nov 13, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1695 tests and 10608 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 14, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1704 tests and 10633 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 16, 2011

Build triggered by changes to the base.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 16, 2011

Build triggered by changes to the head.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 19, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1707 tests and 10661 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 22, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1735 tests and 10781 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 24, 2011

Build triggered by changes to the head.

Unit testing complete. There were 2 failures and 0 errors from 1873 tests and 11091 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 25, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1872 tests and 11090 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Nov 29, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1872 tests and 11090 assertions.
Checkstyle analysis reported 235 warnings and 0 errors.

Contributor

joomla-jenkins commented Dec 2, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1873 tests and 11091 assertions.
Checkstyle analysis reported 334 warnings and 1 errors.

@chdemko chdemko commented on an outdated diff Dec 2, 2011

libraries/joomla/html/html/string.php
+ *
+ * @return void
+ *
+ * @since 11.4
+ */
+ public static function highlighter($terms)
+ {
+ // Get the document object.
+ $doc = JFactory::getDocument();
+
+ // We only want to highlight text on regular html pages.
+ if ($doc->getType() == 'html' && JFactory::getApplication()->input->get('tmpl', null, 'cmd') !== 'component')
+ {
+ // Add the highlighter media.
+ $uncompressed = JFactory::getConfig()->get('debug') ? '-uncompressed' : '';
+ JHtml::_('script', 'system/highlighter' . $uncompressed . '.js', true, true);
@chdemko

chdemko Dec 2, 2011

Contributor

These two lines can be replaced now by
JHtml::_('script', 'system/highlighter.js', true, true);

(the -uncompressed is automatically added)

@chdemko chdemko commented on the diff Dec 2, 2011

libraries/joomla/html/html/string.php
+ /**
+ * Method to setup the JavaScript highlight behavior.
+ *
+ * @param array $terms An array of terms to highlight.
+ *
+ * @return void
+ *
+ * @since 11.4
+ */
+ public static function highlighter($terms)
+ {
+ // Get the document object.
+ $doc = JFactory::getDocument();
+
+ // We only want to highlight text on regular html pages.
+ if ($doc->getType() == 'html' && JFactory::getApplication()->input->get('tmpl', null, 'cmd') !== 'component')
@chdemko

chdemko Dec 2, 2011

Contributor

Is it to this function to test the doc type or the calling one?

@mbabker

mbabker Dec 3, 2011

Owner

It should only trigger the behavior if the doc type being rendered is HTML and not using the component.php template file.

Contributor

joomla-jenkins commented Dec 3, 2011

Build triggered by changes to the head.

Test log missing. Tests failed to execute.
Checkstyle analysis not found.

Owner

mbabker commented Dec 5, 2011

Closing in favor of #608

mbabker closed this Dec 5, 2011

Contributor

joomla-jenkins commented Dec 5, 2011

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1873 tests and 11091 assertions.
Checkstyle analysis reported 254 warnings and 0 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment