diff --git a/client/script.js b/client/script.js index 17401efe..60b59f21 100644 --- a/client/script.js +++ b/client/script.js @@ -192,32 +192,30 @@ function drawNewCard(id, text, x, y, rot, colour, type, sticker, animationspeed) var h = ''; if (type == 'card' || type == null) { - h = '
\ + h = '
\ \ - \ - \ -
' + - text + '
\ + \ + \ +
\
'; } else if (type == 'sticky') { - h = '
\ + h = '
\ \ - \ -
' + - text + '
\ + \ +
\
'; } var card = $(h); + card.attr('id', id).addClass(colour).css('-webkit-transform', 'rotate(' + parseFloat(rot) + 'deg)'); + card.children('.content').attr('id', 'content:' + id).text(text); + card.children('.change-colour').data('colour', colour); + if (type == 'card' || type == null) { + card.children('.card-image').attr('src', 'images/' + colour + '-card.png'); + } else if (type == 'sticky') { + card.children('.card-image').attr('src', 'images/postit/p' + colour + '.png'); + } card.appendTo('#board'); //@TODO @@ -387,13 +385,16 @@ function addSticker(cardId, stickerId) { if (Array.isArray(stickerId)) { for (var i in stickerId) { - stickerContainer.prepend(''); + stickerContainer.prepend( + $('').attr('src', 'images/stickers/' + stickerId[i] + '.png') + ); } } else { - if (stickerContainer.html().indexOf(stickerId) < 0) - stickerContainer.prepend(''); + if (stickerContainer.html().indexOf(stickerId) < 0) { + stickerContainer.prepend( + $('').attr('src', 'images/stickers/' + stickerId + '.png') + ); + } } $(".stuck-sticker").draggable({ @@ -500,7 +501,9 @@ function drawNewColumn(columnName) { $('#icon-col').before('

' + columnName + '

'); + '" class="editable column-editable">'); + + $('#col-' + (totalcolumns + 1)).text(columnName); $('.editable').editable({ multiline: false, @@ -606,8 +609,8 @@ function initColumns(columnArray) { function changeThemeTo(theme) { - currentTheme = theme; - $("link[title=cardsize]").attr("href", "css/" + theme + ".css"); + currentTheme = theme; + $("link[title=cardsize]").attr("href", "css/" + theme + ".css"); } @@ -659,7 +662,7 @@ function displayUserJoined(sid, user_name) { name = sid.substring(0, 5); - $('#names-ul').append('
  • ' + name + '
  • '); + $('#names-ul').append($('
  • ').attr('id', 'user-' + sid).text(name)); } function displayUserLeft(sid) {