User:Canadabonk/common.js: Difference between revisions

Content deleted Content added
Canadabonk (talk | contribs)
No edit summary
Canadabonk (talk | contribs)
No edit summary
Line 66:
//edit button begin
if (!$('body.action-edit').length) {
sidetools.append('<div class="ct-edit"><a class="ct-sidetools-button"></a></div>');
const
faEditButton = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"/></svg>',
faViewSource faEditButton = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M144M362.7 144v48H304V144c019.3L314.3 67.7 444.3 197.7l48.4-4448.24c25-3525 25-65.85 0-8090.5L453.3 19.3c-8025-80s25-8065.5-25-90.5 350zm-71 71L58.86 323.5c-8010.4 80zM8010.4-18 192V144C8023.3-22.2 6437.54L1 144481.2C-1.5 0489.7 224 0s144.8 64498.58 1447 144v48h16c35505s15.3 0 648.5 2823.7 64 64V448c0 356.1l120.3-2835.7 644c14.1-644.2 64H64c27-3511.38 037.4-64-2822.2L421.7-64-64V256c0-35 220.3 28291.7-64 64-64H80z90.3z"/></svg>',
faEditButton faViewSource = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M362.7M144 19.3L314.3 67.7 444.3 197.7l48.4144v48H304V144c0-4844.4c252-25 25-6535.5 08-90.5L453.3 19.3c80-2580-2580s-65.5-25-90.580 0zm-71 71L5835.6 323.5c8-10.480 10.4-1880zM80 23.3-22.2192V144C80 3764.4L15 481.2C-1144.5 489.70 .8224 0s144 49864.85 7144 505s15144v48h16c35.3 8.50 64 2328.7 6.1l12064 64V448c0 35.3-3528.4c14.17 64-4.264 2764H64c-1135.83 37.40-22.2L42164-28.7 220-64-64V256c0-35.3 29128.7-64 90.3z64-64H80z"/></svg>',
cosmosEditButton = $('.cosmos-actions-edit').first(),
editButtonHref = cosmosEditButton.parent().attr('href'),
editButtonText editButtonHref = cosmosEditButton.findparent('.cosmos-button-text').textattr('href'),
editButtonText = cosmosEditButton.find('.cosmos-button-text').text(),
sidetoolsEditButton = $('.ct-edit .ct-sidetools-button');
sidetoolsEditButton.attr({
'href': editButtonHref,
'titlehref': editButtonTexteditButtonHref,
'title': editButtonText
});
});
if (cosmosEditButton.attr('id') == 'ca-viewsource') {
sidetoolsEditButton.append(faViewSource);
} else {
sidetoolsEditButton.append(faEditButton);
});
}
} //end desktop