switched add link section on topic card to be without upload file for now

This commit is contained in:
Connor Turland 2014-10-01 16:44:11 -04:00
parent 8ef56735bf
commit 999dae34ea

View file

@ -683,8 +683,8 @@ Metamaps.TopicCard = {
link: null link: null
}); });
$('.embeds').empty(); $('.embeds').empty();
$('#addLinkInput input').val("");
$('.attachments').removeClass('hidden'); $('.attachments').removeClass('hidden');
$('.addAttachment').show();
$('.CardOnGraph').removeClass('hasAttachment'); $('.CardOnGraph').removeClass('hasAttachment');
}, },
bindShowCardListeners: function (topic) { bindShowCardListeners: function (topic) {
@ -700,21 +700,9 @@ Metamaps.TopicCard = {
Metamaps.Mapper.get(topic.get('user_id'), setMapperImage) Metamaps.Mapper.get(topic.get('user_id'), setMapperImage)
// starting embed.ly // starting embed.ly
var addLinkFunc = function () {
var addLinkDiv ='';
var addLinkDesc ='Enter or paste a link';
addLinkDiv+='<div class="addLink"><div id="addLinkIcon"></div>';
addLinkDiv+='<div id="addLinkInput"><input placeholder="' + addLinkDesc + '"></input>';
addLinkDiv+='<div id="addLinkReset"></div></div></div>';
$('.addAttachment').hide();
$('.attachments').append(addLinkDiv);
$('.showcard #addLinkReset').click(resetFunc);
$('.showcard #addLinkInput input').bind("paste keyup",inputEmbedFunc);
$('#addLinkInput input').focus();
};
var resetFunc = function () { var resetFunc = function () {
$('.addLink').remove(); $('#addLinkInput input').val("");
$('.addAttachment').show(); $('#addLinkInput input').focus();
}; };
var inputEmbedFunc = function (event) { var inputEmbedFunc = function (event) {
@ -734,7 +722,6 @@ Metamaps.TopicCard = {
'data-card-description': '0', 'data-card-description': '0',
href: text href: text
}).html(text); }).html(text);
$('.addLink').remove();
$('.attachments').addClass('hidden'); $('.attachments').addClass('hidden');
$('.embeds').append(embedlyEl); $('.embeds').append(embedlyEl);
$('.embeds').append('<div id="embedlyLinkLoader"></div>'); $('.embeds').append('<div id="embedlyLinkLoader"></div>');
@ -749,6 +736,8 @@ Metamaps.TopicCard = {
} }
}, 100); }, 100);
}; };
$('#addLinkReset').click(resetFunc);
$('#addLinkInput input').bind("paste keyup",inputEmbedFunc);
// initialize the link card, if there is a link // initialize the link card, if there is a link
if (topic.get('link') && topic.get('link') !== '') { if (topic.get('link') && topic.get('link') !== '') {
@ -760,7 +749,6 @@ Metamaps.TopicCard = {
loader.show(); // Hidden by default loader.show(); // Hidden by default
embedly('card', document.getElementById('embedlyLink')); embedly('card', document.getElementById('embedlyLink'));
} }
$('.showcard #addlink').click(addLinkFunc);
var selectingMetacode = false; var selectingMetacode = false;
@ -940,9 +928,9 @@ Metamaps.TopicCard = {
} }
if (authorized) { if (authorized) {
nodeValues.attachments = '<div class="addAttachment">'; nodeValues.attachments = '<div class="addLink"><div id="addLinkIcon"></div>';
nodeValues.attachments += '<div id="addlink"><div id="linkIcon" class="attachmentIcon"></div>Attach a link</div>'; nodeValues.attachments += '<div id="addLinkInput"><input placeholder="Enter or paste a link"></input>';
nodeValues.attachments += '<div id="addupload"><div id="uploadIcon" class="attachmentIcon"></div>Upload a file</div></div>'; nodeValues.attachments += '<div id="addLinkReset"></div></div></div>';
} else { } else {
nodeValues.attachmentsHidden = 'hidden'; nodeValues.attachmentsHidden = 'hidden';
nodeValues.attachments = ''; nodeValues.attachments = '';