I'm try to create a Window
which will show AddToAny share buttons . I need to set AddToAny 's required script
under this window. I've google similar question within Social Media buttons.
Mashup
class could work. I've create a mixin
class but unfortunately this is not working.html
config but this isn't work either.How can I achieve to my aim?
//Here is related function.
onMoreShare: function () {
new Ext.window.Window({
// requires: ['MyApp.mixins.ShareApps'], //Tried to load JS file to Window
title: 'More...',
autoShow: true,
modal: true,
padding: 20,
html: '<a class="a2a_dd" href="https://www.addtoany.com/share"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" width="171" height="16" border="0" alt="Share"></a>\n' +
// Mixin didn't work; tried original code...
// '<script async src="https://static.addtoany.com/menu/page.js"></script>\n' +
// Mixin didn't work; tried to call js file through project
//'<script type="text/javascript" src="../../../resources/js/addToAny.js"></script>\n'
});
}
//Created this `Mashup` based class to load related JS file.
Ext.define('MyApp.mixins.ShareApps', {
mixins: ['Ext.mixin.Mashup'],
requiredScripts: [
'//static.addtoany.com/menu/page.js'
]
});
Take a look at this fiddle:
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.widget('window', {
width: 300,
height: 250,
padding: 5,
title: 'Hello World',
html: '<div class="a2a_kit a2a_kit_size_32 a2a_default_style"> '+
'<a class="a2a_dd" href="https://www.addtoany.com/share"></a> '+
'<a class="a2a_button_facebook"></a> '+
'<a class="a2a_button_twitter"></a> '+
'<a class="a2a_button_google_plus"></a> '+
'</div>'
}).show();
}
});
Index page:
<html>
<head>
<script async src="https://static.addtoany.com/menu/page.js"></script>
</head>
</html>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.