source: extensions/Slide/js/plugin/SlideSmiliesSupport.js @ 27780

Last change on this file since 27780 was 27780, checked in by Miklfe, 10 years ago

Compatible avec Smilies Support

File size: 1.8 KB
Line 
1/*
2 * SlideMyPiwiShop - v1.0 - 01-01-2014
3 * plugin for Slide and Smilies Support
4 * Original by mistic100, P@t, Atadilo for Smilies Support : http://fr.piwigo.org/ext/extension_view.php?eid=159
5 * Modified by Miklfe : http://piwitheme.fr/
6 *
7 */
8
9
10
11function _SmiliesSupport(){
12        var $layerShow  = $('body').data('layerShow');
13       
14        if($('#the_page', $layerShow).hasClass('thePicturePage') && $layerShow.attr('id')!='layer-0') {
15                $.getScript('./plugins/SmiliesSupport/template/markitup/jquery.markitup.js', function(){
16                        $('body').removeClass('MyPiwiShop').addClass('MyPiwiShopReady');
17
18                        var $ele                = $('#content', $layerShow),
19                       
20                                $SmS_repr       = $ele.data('smiliessupportr'),                         
21                                $SmS_Tid        = $ele.data('smiliessupporttid'),
22                                $T_id           = $ele.find('div [id=' + $SmS_Tid + ']');
23                               
24                        $('#allsmilies').addClass('noSlide').removeClass('slide');
25                       
26                        if ($('.markItUp').length == 0) {
27                                $T_id.markItUp({
28                                        markupSet: []
29                                });
30                                $('.markItUpHeader>ul').css('width', '22');
31                        } else {
32                                $('.markItUpHeader>ul').css('width', '+=22');
33                        }
34
35                        $('#SmiliesSupport').appendTo('.markItUpHeader ul:first-child');
36
37                        $('#allsmilies').hover(function(){ 
38                                $T_id.focus();
39                                $('#smiliesdiv').css('display', ''); 
40                        });
41
42                        $('#smiliesdiv img').click(function() {
43                                var $emoticon = jQuery(this).attr('title');
44                                $.markItUp({
45                                        replaceWith: $emoticon
46                                });
47                       
48                                $('#smiliesdiv').css('display', 'none');
49                               
50                               
51                                return false;
52                        });
53                       
54                        var $SmS_css = '#SmiliesSupport table img:hover {border:1px solid #08e;margin:-1px;border-radius:2px;cursor:pointer} #allsmilies{background-size:contain;background-image:url("' + $SmS_repr + '")';
55
56                        $("<style />", {
57                                type: "text/css",
58                        }).append($SmS_css).appendTo('head');
59                });
60        }
61};
62
Note: See TracBrowser for help on using the repository browser.