diff --git a/buildout.cfg b/buildout.cfg index ff78820..b1e81b3 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -12,6 +12,11 @@ parts += i18ndude omelette rebuild_i18n-sh + webpack + webpack_env + npm_watch + npm_dev + npm_build [code-analysis] recipe = plone.recipe.codeanalysis[recommended] @@ -32,6 +37,57 @@ eggs = i18ndude recipe = collective.recipe.omelette eggs = ${instance:eggs} +[webpack] +recipe = gp.recipe.node +version = 6.6.0 +npms = npm yarn webpack@2 +scripts = npm yarn webpack + +[webpack_env] +recipe = collective.recipe.template +input = inline: + #!/bin/sh + export PATH=${buildout:bin-directory}:$PATH + cd webpack + yarn + exec $SHELL +output = ${buildout:bin-directory}/webpack_env +mode = 755 + +[npm_watch] +recipe = collective.recipe.template +input = inline: + #!/bin/sh + PATH=${buildout:bin-directory}:$PATH + cd webpack + yarn + npm run watch +output = ${buildout:bin-directory}/npm_watch +mode = 755 + +[npm_dev] +recipe = collective.recipe.template +input = inline: + #!/bin/sh + PATH=${buildout:bin-directory}:$PATH + cd webpack + yarn + npm run dev +output = ${buildout:bin-directory}/npm_dev +mode = 755 + +[npm_build] +recipe = collective.recipe.template +input = inline: + #!/bin/sh + PATH=${buildout:bin-directory}:$PATH + cd webpack + yarn + npm run build +output = ${buildout:bin-directory}/npm_build +mode = 755 + [versions] # use latest version of coverage coverage = + diff --git a/src/collective/newsticker/browser/static/controls.png b/src/collective/newsticker/browser/static/controls.png index 08535be..fd65904 100644 Binary files a/src/collective/newsticker/browser/static/controls.png and b/src/collective/newsticker/browser/static/controls.png differ diff --git a/src/collective/newsticker/browser/static/jquery.ticker.js b/src/collective/newsticker/browser/static/jquery.ticker.js deleted file mode 100644 index 96799e8..0000000 --- a/src/collective/newsticker/browser/static/jquery.ticker.js +++ /dev/null @@ -1,427 +0,0 @@ -/* - jQuery News Ticker is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, version 2 of the License. - - jQuery News Ticker is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with jQuery News Ticker. If not, see . -*/ -(function($){ - $.fn.ticker = function(options) { - // Extend our default options with those provided. - // Note that the first arg to extend is an empty object - - // this is to keep from overriding our "defaults" object. - var opts = $.extend({}, $.fn.ticker.defaults, options); - - // check that the passed element is actually in the DOM - if ($(this).length == 0) { - if (window.console && window.console.log) { - window.console.log('Element does not exist in DOM!'); - } - else { - alert('Element does not exist in DOM!'); - } - return false; - } - - /* Get the id of the UL to get our news content from */ - var newsID = '#' + $(this).attr('id'); - - /* Get the tag type - we will check this later to makde sure it is a UL tag */ - var tagType = $(this).get(0).tagName; - - return this.each(function() { - // get a unique id for this ticker - var uniqID = getUniqID(); - - /* Internal vars */ - var settings = { - position: 0, - time: 0, - distance: 0, - newsArr: {}, - play: true, - paused: false, - contentLoaded: false, - dom: { - contentID: '#ticker-content-' + uniqID, - titleID: '#ticker-title-' + uniqID, - titleElem: '#ticker-title-' + uniqID + ' SPAN', - tickerID : '#ticker-' + uniqID, - wrapperID: '#ticker-wrapper-' + uniqID, - revealID: '#ticker-swipe-' + uniqID, - revealElem: '#ticker-swipe-' + uniqID + ' SPAN', - controlsID: '#ticker-controls-' + uniqID, - prevID: '#prev-' + uniqID, - nextID: '#next-' + uniqID, - playPauseID: '#play-pause-' + uniqID - } - }; - - // if we are not using a UL, display an error message and stop any further execution - if (tagType != 'UL' && tagType != 'OL' && opts.htmlFeed === true) { - debugError('Cannot use <' + tagType.toLowerCase() + '> type of element for this plugin - must of type