|
| 1 | +function _GRCRTMovedFrames(){ |
| 2 | + "use strict"; |
| 3 | + |
| 4 | + function activity_commands_list(){ |
| 5 | + if($('#toolbar_activity_commands_list').length==0){ |
| 6 | + setTimeout(function(){ |
| 7 | + activity_commands_list() |
| 8 | + },500); |
| 9 | + return; |
| 10 | + } |
| 11 | + // command list |
| 12 | + if($('#grcrt_taclWrap').length==0){ |
| 13 | + $('#toolbar_activity_commands_list').wrap($('<div/>',{'class':'grcrt_taclWrap', 'id':'grcrt_taclWrap'})) |
| 14 | + if(RepConv.settings[RepConv.Cookie+'_tacl']){ |
| 15 | + $('#toolbar_activity_commands_list').addClass('grcrt_tacl') |
| 16 | + $('#grcrt_taclWrap').draggable().draggable('enable') |
| 17 | + } else { |
| 18 | + $('#toolbar_activity_commands_list').removeClass('grcrt_tacl') |
| 19 | + $('#grcrt_taclWrap').draggable().draggable('disable').removeAttr('style') |
| 20 | + } |
| 21 | + } |
| 22 | + |
| 23 | + var |
| 24 | + tacl_id = '#toolbar_activity_commands_list', |
| 25 | + tacl_clk = '.activity.commands', |
| 26 | + target_tacl = document.querySelector(tacl_id), |
| 27 | + observer_tacl = new MutationObserver(function(mutations) { |
| 28 | + mutations.forEach(function(mutation) { |
| 29 | + if($(target_tacl).hasClass('grcrt_tacl') && ($('#grcrt_taclWrap').attr('style') && $(target_tacl).css('display')=="none")){ |
| 30 | + $(tacl_clk).trigger('mouseenter') |
| 31 | + } |
| 32 | + }); |
| 33 | + }); |
| 34 | + if($(tacl_id+">.js-dropdown-list>a.cancel").length == 0){ |
| 35 | + $(tacl_id+">.js-dropdown-list") |
| 36 | + .append( |
| 37 | + $('<a/>',{'href':'#n','class':'cancel', 'style':'display:none;'}) |
| 38 | + .click(function(){ |
| 39 | + $('#grcrt_taclWrap').removeAttr('style') |
| 40 | + }) |
| 41 | + ) |
| 42 | + } |
| 43 | + observer_tacl.observe(target_tacl, { attributes: true, childList: false, characterData: false }); |
| 44 | + } |
| 45 | + |
| 46 | + // function activity_trades_list(){ |
| 47 | + // if($('#toolbar_activity_trades_list').length==0){ |
| 48 | + // setTimeout(function(){ |
| 49 | + // activity_trades_list() |
| 50 | + // },500); |
| 51 | + // return; |
| 52 | + // } |
| 53 | + // var |
| 54 | + // tatl_id = '#toolbar_activity_trades_list', |
| 55 | + // tatl_clk = '.activity.trades' |
| 56 | + // if($('#grcrt_tatlWrap').length==0){ |
| 57 | + // $('#toolbar_activity_trades_list').wrap($('<div/>',{'class':'grcrt_tatlWrap', 'id':'grcrt_tatlWrap'})) |
| 58 | + // if(RepConv.settings[RepConv.Cookie+'_tatl']){ |
| 59 | + // $('#toolbar_activity_trades_list').addClass('grcrt_tatl') |
| 60 | + // $('#grcrt_tatlWrap').draggable().draggable('enable') |
| 61 | + // } else { |
| 62 | + // $('#toolbar_activity_trades_list').removeClass('grcrt_tatl') |
| 63 | + // $('#grcrt_tatlWrap').draggable().draggable('disable').removeAttr('style') |
| 64 | + // } |
| 65 | + // } |
| 66 | + |
| 67 | + // if($(tatl_clk).hasClass('active')){ |
| 68 | + // $(tatl_id) |
| 69 | + // .append( |
| 70 | + // $('<a/>',{'href':'#n','class':'cancel', 'style':'display:none;'}) |
| 71 | + // .click(function(){ |
| 72 | + // $('#grcrt_tatlWrap').removeAttr('style') |
| 73 | + // }) |
| 74 | + // ) |
| 75 | + // } else { |
| 76 | + // var |
| 77 | + // target_tatl = document.querySelector(tatl_id), |
| 78 | + // observer_tatl = new MutationObserver(function(mutations) { |
| 79 | + // mutations.forEach(function(mutation) { |
| 80 | + // if($(target_tatl).hasClass('grcrt_tatl') && ($('#grcrt_tatlWrap').attr('style') && $(target_tatl).css('display')=="none")){ |
| 81 | + // $(tatl_clk).trigger('mouseenter') |
| 82 | + // } |
| 83 | + // }); |
| 84 | + // }); |
| 85 | + // $(tatl_id+">.js-dropdown-list") |
| 86 | + // .append( |
| 87 | + // $('<a/>',{'href':'#n','class':'cancel', 'style':'display:none;'}) |
| 88 | + // .click(function(){ |
| 89 | + // $('#grcrt_tatlWrap').removeAttr('style') |
| 90 | + // }) |
| 91 | + // ) |
| 92 | + // observer_tatl.observe(target_tatl, { attributes: true, childList: false, characterData: false }); |
| 93 | + // } |
| 94 | + // } |
| 95 | + |
| 96 | + $('head') |
| 97 | + .append( |
| 98 | + $('<style/>') |
| 99 | + .append( // frozen lists |
| 100 | + $('<style/>') |
| 101 | + .append('.showImportant { bisplay: block !important}') |
| 102 | + |
| 103 | + .append('#grcrt_taclWrap { left:312px; position: absolute; top: 29px;}') |
| 104 | + .append('#grcrt_taclWrap>#toolbar_activity_commands_list { left: 0 !important; top: 0 !important;}') |
| 105 | + .append('.grcrt_tacl { z-index:5000 !important;}') |
| 106 | + .append('.grcrt_tacl>.js-dropdown-list>a.cancel { position: relative; float: right; margin-bottom: 11px;display:none; opacity: 0; visibility: hidden; transition: visibility 0s, opacity 0.5s linear;}') |
| 107 | + .append('.grcrt_tacl>.js-dropdown-list:hover>a.cancel { display: block !important; visibility: visible; opacity: 0.5;}') |
| 108 | + .append('.grcrt_tacl>.js-dropdown-list>a.cancel:hover { opacity: 1;}') |
| 109 | + |
| 110 | + // .append('#grcrt_tatlWrap { left:340px; position: absolute; top: 29px;}') |
| 111 | + // .append('#grcrt_tatlWrap>#toolbar_activity_trades_list { left: 0 !important; top: 0 !important;}') |
| 112 | + // .append('.grcrt_tatl { z-index:5000 !important;}') |
| 113 | + // .append('.grcrt_tatl>a.cancel { position: relative; float: right; margin-bottom: 11px;display:none; opacity: 0; visibility: hidden; transition: visibility 0s, opacity 0.5s linear;}') |
| 114 | + // .append('.grcrt_tatl:hover>a.cancel { display: block !important; visibility: visible; opacity: 0.5;}') |
| 115 | + // .append('.grcrt_tatl>a.cancel:hover { opacity: 1;}') |
| 116 | + // .append('.grcrt_tatl>.js-dropdown-list>a.cancel { position: relative; float: right; margin-bottom: 11px;display:none; opacity: 0; visibility: hidden; transition: visibility 0s, opacity 0.5s linear;}') |
| 117 | + // .append('.grcrt_tatl>.js-dropdown-list:hover>a.cancel { display: block !important; visibility: visible; opacity: 0.5;}') |
| 118 | + // .append('.grcrt_tatl>.js-dropdown-list>a.cancel:hover { opacity: 1;}') |
| 119 | + |
| 120 | + |
| 121 | + // .append('.grcrt_tarl>a.cancel,.grcrt_tacl>a.cancel,.grcrt_tatl>a.cancel { position: relative; float: right; margin-bottom: 0px;display:none; opacity: 0; visibility: hidden; transition: visibility 0s, opacity 0.5s linear;}') |
| 122 | + // .append('.grcrt_tarl:hover>a.cancel,.grcrt_tacl:hover>a.cancel,.grcrt_tatl:hover>a.cancel { display: block !important; visibility: visible; opacity: 0.5;}') |
| 123 | + // .append('.grcrt_tarl>a.cancel:hover,.grcrt_tacl>a.cancel:hover,.grcrt_tatl>a.cancel:hover { opacity: 1;}') |
| 124 | + // .append('.grcrt_tacl>.js-dropdown-list:after {content: "___"; float: right; height: 30px; background: transparent url(https://cdn1.iconfinder.com/data/icons/interface-4/96/Cursor-Move-16.png) no-repeat top right; color: transparent;position:relative}') |
| 125 | + // .append('.grcrt_tacl>.js-dropdown-list:after:hover {height: 30px;}') |
| 126 | + // .append('.grcrt_tacl>.js-dropdown-item-list:after {content: "___"; float: right; height: 19px; background: transparent url(https://cdn1.iconfinder.com/data/icons/interface-4/96/Cursor-Move-16.png) no-repeat top right; color: transparent;position:relative}') |
| 127 | + // .append('.grcrt_tacl>.js-dropdown-item-list:after:hover {height: 30px;}') |
| 128 | + ) |
| 129 | + ); |
| 130 | + |
| 131 | + RepConv.sChbxs[RepConv.Cookie+'_tacl'] = { label : 'CHKTACL', default : true} |
| 132 | + // RepConv.sChbxs[RepConv.Cookie+'_tatl'] = { label : 'CHKTATL', default : true} |
| 133 | + |
| 134 | + $.Observer(GameEvents.grcrt.settings.load) |
| 135 | + .subscribe('GRCRTMovedFrames_settings_load', function() { |
| 136 | + activity_commands_list(); |
| 137 | + // activity_trades_list(); |
| 138 | + }); |
| 139 | +} |
0 commit comments