-
Notifications
You must be signed in to change notification settings - Fork 33
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 #4 from TheDMSGroup/ENG-91-autocomplete-tokens
[ENG-119] Initial codemirror support for Raw and other JS improvements.
- Loading branch information
Showing
15 changed files
with
202 additions
and
137 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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
.idea | ||
composer.lock | ||
# Standard .gitignore for a Mautic plugin. | ||
.* | ||
!.gitignore | ||
!.htaccess | ||
!.gitkeep | ||
!.travis.yml | ||
vendor | ||
node_modules |
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,62 @@ | ||
# Standard .travis.yml for a Mautic plugin. Adjust env variables as needed. | ||
env: | ||
global: | ||
# The exact plugin folder/bundle name. | ||
- "MAUTIC_PLUGIN=MauticContactClientBundle" | ||
|
||
dist: precise | ||
|
||
language: php | ||
|
||
services: | ||
- mysql | ||
|
||
php: | ||
- 5.6.19 | ||
- 7.0 | ||
- 7.1 | ||
|
||
before_install: | ||
|
||
# Create mautictest database. | ||
- mysql -e 'CREATE DATABASE mautictest;' | ||
|
||
# Turn off XDebug. | ||
- phpenv config-rm xdebug.ini || return | ||
|
||
# Install dependencies in parallel. | ||
- travis_retry composer global require hirak/prestissimo | ||
|
||
# Set to test environment for Symfony's commands in post install commands. | ||
- export SYMFONY_ENV="test" | ||
|
||
# Install PHPSTAN for PHP 7+ | ||
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then composer global require phpstan/phpstan-shim:0.8.5; fi | ||
|
||
# Clone the latest core release. | ||
- git clone -b master --single-branch --depth 1 https://github.com/mautic/mautic.git /tmp/mautic | ||
|
||
# Combine core with our plugin. | ||
- mkdir -p /tmp/mautic/plugins/$MAUTIC_PLUGIN | ||
- rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/ /tmp/mautic/plugins/$MAUTIC_PLUGIN | ||
- rsync -r --delete-after --quiet /tmp/mautic/ $TRAVIS_BUILD_DIR/ | ||
|
||
install: | ||
|
||
# Install core dependencies. | ||
- composer install | ||
|
||
# Install plugin dependencies (if any). | ||
- composer require wikimedia/composer-merge-plugin | ||
- composer config extra.merge-plugin.include plugins/$MAUTIC_PLUGIN/composer.json | ||
|
||
script: | ||
|
||
# Run PHPUnit including core tests to find potential BC breaks. | ||
- bin/phpunit --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --fail-on-warning | ||
|
||
# Run PHPSTAN analysis for PHP 7+ only in the scope of this plugin. | ||
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then ~/.composer/vendor/phpstan/phpstan-shim/phpstan.phar analyse plugins/$MAUTIC_PLUGIN; fi | ||
|
||
# Check code standards for PHP 7.1 only in the scope of this plugin. | ||
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then bin/php-cs-fixer fix -v --dry-run --diff plugins/$MAUTIC_PLUGIN; fi |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,8 +1,8 @@ | ||
// @todo - Filtering field. | ||
Mautic.contactclientFilter = function () { | ||
var $filter = mQuery('#contactclient_filter'); | ||
if (typeof window.contactclientFilterLoaded === 'undefined' && $filter.length) { | ||
var $filter = mQuery('#contactclient_filter:not(.hide):first'); | ||
if ($filter.length) { | ||
|
||
|
||
window.contactclientFilterLoaded = true; | ||
} | ||
}; |
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,70 +1,65 @@ | ||
Mautic.contactclientTimelineOnLoad = function (container, response) { | ||
|
||
if (typeof window.contactclientTimelineLoaded === 'undefined') { | ||
|
||
window.contactclientTimelineLoaded = true; | ||
|
||
var codeMirror = function ($el) { | ||
if (!$el.hasClass('codemirror-active')) { | ||
var $textarea = $el.find('textarea.codeMirror-yaml'); | ||
if ($textarea.length) { | ||
CodeMirror.fromTextArea($textarea[0], { | ||
mode: 'yaml', | ||
theme: 'material', | ||
gutters: [], | ||
lineNumbers: false, | ||
lineWrapping: true, | ||
readOnly: true | ||
}); | ||
} | ||
$el.addClass('codemirror-active'); | ||
} | ||
}; | ||
mQuery('#contactclient-timeline a[data-activate-details=\'all\']').on('click', function () { | ||
if (mQuery(this).find('span').first().hasClass('fa-level-down')) { | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').each(function () { | ||
var detailsId = mQuery(this).data('activate-details'), | ||
$details = mQuery('#timeline-details-' + detailsId); | ||
if (detailsId && $details.length) { | ||
$details.removeClass('hide'); | ||
codeMirror($details); | ||
mQuery(this).addClass('active'); | ||
} | ||
}); | ||
mQuery(this).find('span').first().removeClass('fa-level-down').addClass('fa-level-up'); | ||
} | ||
else { | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').each(function () { | ||
var detailsId = mQuery(this).data('activate-details'), | ||
$details = mQuery('#timeline-details-' + detailsId); | ||
if (detailsId && $details.length) { | ||
$details.addClass('hide'); | ||
mQuery(this).removeClass('active'); | ||
} | ||
var codeMirror = function ($el) { | ||
if (!$el.hasClass('codemirror-active')) { | ||
var $textarea = $el.find('textarea.codeMirror-yaml'); | ||
if ($textarea.length) { | ||
CodeMirror.fromTextArea($textarea[0], { | ||
mode: 'yaml', | ||
theme: 'material', | ||
gutters: [], | ||
lineNumbers: false, | ||
lineWrapping: true, | ||
readOnly: true | ||
}); | ||
mQuery(this).find('span').first().removeClass('fa-level-up').addClass('fa-level-down'); | ||
} | ||
}); | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').on('click', function () { | ||
var detailsId = mQuery(this).data('activate-details'); | ||
if (detailsId && mQuery('#timeline-details-' + detailsId).length) { | ||
var activateDetailsState = mQuery(this).hasClass('active'), | ||
$el.addClass('codemirror-active'); | ||
} | ||
}; | ||
mQuery('#contactclient-timeline a[data-activate-details=\'all\']').on('click', function () { | ||
if (mQuery(this).find('span').first().hasClass('fa-level-down')) { | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').each(function () { | ||
var detailsId = mQuery(this).data('activate-details'), | ||
$details = mQuery('#timeline-details-' + detailsId); | ||
|
||
if (activateDetailsState) { | ||
$details.addClass('hide'); | ||
mQuery(this).removeClass('active'); | ||
} | ||
else { | ||
if (detailsId && $details.length) { | ||
$details.removeClass('hide'); | ||
codeMirror($details); | ||
mQuery(this).addClass('active'); | ||
} | ||
} | ||
}); | ||
}); | ||
mQuery(this).find('span').first().removeClass('fa-level-down').addClass('fa-level-up'); | ||
} | ||
else { | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').each(function () { | ||
var detailsId = mQuery(this).data('activate-details'), | ||
$details = mQuery('#timeline-details-' + detailsId); | ||
if (detailsId && $details.length) { | ||
$details.addClass('hide'); | ||
mQuery(this).removeClass('active'); | ||
} | ||
}); | ||
mQuery(this).find('span').first().removeClass('fa-level-up').addClass('fa-level-down'); | ||
} | ||
}); | ||
mQuery('#contactclient-timeline a[data-activate-details!=\'all\']').on('click', function () { | ||
var detailsId = mQuery(this).data('activate-details'); | ||
if (detailsId && mQuery('#timeline-details-' + detailsId).length) { | ||
var activateDetailsState = mQuery(this).hasClass('active'), | ||
$details = mQuery('#timeline-details-' + detailsId); | ||
|
||
if (response && typeof response.timelineCount !== 'undefined') { | ||
mQuery('#TimelineCount').html(response.timelineCount); | ||
if (activateDetailsState) { | ||
$details.addClass('hide'); | ||
mQuery(this).removeClass('active'); | ||
} | ||
else { | ||
$details.removeClass('hide'); | ||
codeMirror($details); | ||
mQuery(this).addClass('active'); | ||
} | ||
} | ||
}); | ||
|
||
if (response && typeof response.timelineCount !== 'undefined') { | ||
mQuery('#TimelineCount').html(response.timelineCount); | ||
} | ||
}; |
Oops, something went wrong.