Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing semicolons causes code to break #33

Open
rshimshock opened this issue Apr 10, 2016 · 2 comments
Open

Missing semicolons causes code to break #33

rshimshock opened this issue Apr 10, 2016 · 2 comments

Comments

@rshimshock
Copy link

The code is missing a number of semicolon delimiters, which causes problems when attempting to aggregate and compress the code with other JavaScript files. The following updates are necessary to Version 2.1.1:

Line 83: missing semicolon
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L83

var $this = $(this),
item = {
  title: $this.find("title").text(),
  link: $this.find("link").text()
}  // <----- missing

Line 141: commented code causes error because it is missing semicolon when aggregated
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L141

if (settings.startEmpty){
  var height = $strip.find("li:first").height();
  $strip.prepend('<li class="webticker-init" style="width:'+$strip.parent().width()+'px;height:'+height+'px;"></li>');
}
//extra width to be able to move items without any jumps    $strip.find("li:first").width()  // <---- problem

Line 184: missing semicolon
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L184

var $mask = $strip.wrap("<div class='mask'></div>");
$mask.after("<span class='tickeroverlay-left'>&nbsp;</span><span class='tickeroverlay-right'>&nbsp;</span>")  // <---- missing
var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");

Line 254: missing semicolon
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L254

    cont : function( ) {
        var settings = $(this).data('settings')  // <---- missing
        if (!settings.moving){
            settings.moving = true;

Lines 308 & 309: Extra semicolon and unnecessary semicolon
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L308
https://github.com/jonmifsud/Web-Ticker/blob/master/jquery.webticker.js#L309

// should the update be a 'hot-swap' or use replacement for IDs (in which case remove new ones)
$strip.children('li').addClass('old');
for (var i = 0; i < list.length; i++) {
  id = $(list[i]).data('update');
  match = $strip.find('[data-update="'+id+'"]');//should try find the id or data-attribute.
  if (match.length < 1){
    if (insert){
      //we need to move this item into the dom
      if ($strip.find('.ticker-spacer:first-child').length == 0 && $strip.find('.ticker-spacer').length > 0){
        $strip.children('li.ticker-spacer').before(list[i]);
      }
      else {
        $strip.append(list[i]);
      }
    }
  } else $strip.find('[data-update="'+id+'"]').replaceWith(list[i]);;  // <--- extra unnecessary semicolon
};  // <---- unneeded semicolon at end of for loop
@gitFrank
Copy link

gitFrank commented Jun 6, 2016

Hi, thanks for that. I wonder why the ticker works also without this changes.

@rshimshock
Copy link
Author

It works if it is not compressed. We compress our JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants