PageSourceSearch

https://www.qooq.com/sites/all/modules/custom/qooq_technique_sheet/js/qooq_technique_sheet.js?qmgln2

js qooq.com collected 2026-10-02 11:42:39 UTC 12,578 bytes, 272 lines download raw bytes

1(function($) {
2
3  Drupal.behaviors.qooq_technique_sheet = {};
4
5  Drupal.behaviors.qooq_technique_sheet = {
6    attach: function(context, settings) {
7
8        if ($('.vocabulary-techniques').length) {
9          var $vocabularyTechnique = $('.vocabulary-techniques');
10          var $answers_actions = $vocabularyTechnique.find('.answers.actions');
11          //var $detailContentTechnique = $vocabularyTechnique.find('.detail-content-technique');
12          var $btn_blocks = $vocabularyTechnique.find('.technique-sheet-image').find('.left-block, .right-block');
13          var $buttonRadioProfileType = $('.form-item-ajax-profile-types-sheet').find('.form-radio');
14          var $technique_return = $vocabularyTechnique.find('.technique-return');
15          var tid_profile_type = $answers_actions.attr('data-tid_profile_type');
16
17          $technique_return.on('click', function(e){
18            e.preventDefault();
19            Drupal.behaviors.qooq_technique_sheet.goBack();
20          });
21
22          if ($('body').hasClass('not-logged-in')) {
23            $btn_blocks.on('click', function(e) {
24                var $modalOverlay = $('.modal-login-overlay');
25                var $modal = $('.modal-login');
26                $modalOverlay.addClass('modal-login-overlay--visible');
27                $modal.addClass('modal-login--visible');
28            });
29          }
30          $buttonRadioProfileType.off('click').on('click', function(e) {
31            var $field_id_ror_technique = $('.form-item-my-level-id-ror-technique-sheet').find('.form-text');
32            var this_val_idror = $answers_actions.attr('data-idror-technique');
33            $field_id_ror_technique.attr('value',this_val_idror).val(this_val_idror);
34          });
35
36          if (parseInt(tid_profile_type)>0) {
37            $buttonRadioProfileType.each(function(index){
38              if ($(this).attr('value')==tid_profile_type) {
39                $(this).prop('checked', 'checked');
40              }
41              //if ($(this).attr('value')==0) {
42              //  $(this).parent('.form-item-trash').removeClass('hidden');
43              //}
44            });
45          }
46          if ($('.video-technique').length) {
47            var $link_step_timecode = $('#step-by-step-technique').find('.step-timecode');
48            var player =  videojs('video-technique', {
49                 //option_video
50                 controlBar: {
51                     children: [
52                       "durationDisplay",
53                       "timeDivider",
54                       "currentTimeDisplay",
55                       "progressControl",
56                       "playToggle",
57                       "VolumePanel",
58                       //"VolumePanel": {'inline':false},
59                       //"remainingTimeDisplay",
60                       //"CustomControlsSpacer",
61                       "fullscreenToggle"
62                     ]
63                 },
64               }, function(){
65                   // console.log('Init Player Video');
66                   // Player (this) is initialized and ready.
67               });
68            player.on('playing', function() {
69                $('.banner').hide();
70            });
71            //player.on('pause', function(){
72            //    $('.banner').show("slow");
73            //});
74
75           $link_step_timecode.on('click', function(event_step) {
76               event_step.preventDefault();
77               var id_player = $('.video-technique').find('video').attr('id');
78               var player = videojs(id_player);
79               var timecode = $(this).attr('data-timecode');
80               player.play();
81               player.currentTime(timecode);
82           });
83          }
84
85          var $reopen = $('.technique-associated').find('.reopen-modal-technique');
86          $reopen.off('click').on('click', function(event_reopen) {
87              var idror_associated_technique = $(this).attr('data-idror');
88              var tid_associated_technique = $(this).attr('data-tid_technique');
89              // console.log(tid_associated_technique);
90              event_reopen.stopPropagation();
91              if (parseInt(tid_associated_technique)) {
92                $(location).attr('href',"/taxonomy/term/"+tid_associated_technique);
93              }
94          });
95
96        }
97
98        if ($('.modal-technique').length) {
99
100            var $modalTechnique = $('.modal-technique');
101            var $openTechniqueModal = $('.open-modal-technique');
102            var $detailContentTechnique = $modalTechnique.find('.detail-content-technique');
103            var $modal_technique_close = $('.modal-technique-close, .modal-technique_');
104
105            $openTechniqueModal.off('click').on('click', function(e, tid_associated){
106                var idror_technique = $(this).attr('data-idror');
107                var tid_technique = $(this).attr('data-tid_technique');
108
109                if (tid_associated!=undefined) {
110                    // console.log(tid_associated, tid_technique);
111                    tid_technique = tid_associated;
112                    e.stopPropagation();
113                }
114                if (tid_technique!=undefined) {
115                    var request = $.ajax({
116                      url: "/technique/ajax_link_callback/nojs/"+tid_technique,
117                      type: "GET",
118                      data: {},
119                      //async: true,
120                      beforeSend: function (eb) {
121                          // $detailContentTechnique.empty();
122                      },
123                      success: function (data) {
124                         var id_ror = data.id_ror;
125
126                         var $answers_actions = $('.answers.actions');
127                         var $answers_actions_before = $detailContentTechnique.find('.answers.actions').clone();
128
129                         if ($answers_actions_before.length) console.log($answers_actions_before);
130
131                         $detailContentTechnique.html(data.view);
132
133                         var $btn_profile_type = $detailContentTechnique.find('.technique-sheet-image').find('.left-block');
134                         var $buttonRadioProfileType = $('.form-item-ajax-profile-types-sheet').find('.form-radio');
135
136                         var option_video = {
137                           controlBar : {
138                             children :[
139                               "durationDisplay",
140                               "timeDivider",
141                               "currentTimeDisplay",
142                               "progressControl",
143                               "playToggle",
144                               "VolumePanel",//: {'inline':false},
145                               //"remainingTimeDisplay",
146                               //"CustomControlsSpacer",
147                               "fullscreenToggle"
148                             ]
149                           }
150                         };
151
152                        // console.log(option_video);
153                         var player =  videojs('video-technique', {
154                              //option_video
155                              controlBar: {
156                                  children: [
157                                    "durationDisplay",
158                                    "timeDivider",
159                                    "currentTimeDisplay",
160                                    "progressControl",
161                                    "playToggle",
162                                    "VolumePanel",
163                                    //"VolumePanel": {'inline':false},
164                                    //"remainingTimeDisplay",
165                                    //"CustomControlsSpacer",
166                                    "fullscreenToggle"
167                                  ]
168                              },
169                            }, function(){
170                                // console.log('Init Player Video');
171                          // Player (this) is initialized and ready.
172                         });
173
174                         player.on('playing', function() {
175                             $('.banner').hide();
176                         });
177
178                         var $link_step_timecode = $('#step-by-step-technique').find('.step-timecode');
179                         var $reopen = $('.technique-associated').find('.reopen-modal-technique');
180
181                         $reopen.off('click').on('click', function(event_reopen) {
182                             var idror_associated_technique = $(this).attr('data-idror');
183                             var tid_associated_technique = $(this).attr('data-tid_technique');
184                             // console.log(tid_associated_technique);
185                             event_reopen.stopPropagation();
186                             player.ready(function(){
187                                 player.dispose();
188                                 $openTechniqueModal.triggerHandler('click', tid_associated_technique);
189                             });
190
191                         });
192
193                         $link_step_timecode.on('click', function(event_step) {
194                             event_step.preventDefault();
195                             var id_player = $('.video-technique').find('video').attr('id');
196                             var player = videojs(id_player);
197                             var timecode = $(this).attr('data-timecode');
198                             player.play();
199                             player.currentTime(timecode);
200                         });
201                         // player.on('timeupdate', function() {
202                         //   // console.log(this.currentTime());
203                         // });
204
205                         //var $buttonRadioProfileType = $detailContentTechnique.find('.form-item-ajax-profile-types').find('.form-radio', context);
206                         // if ($btn_profile_type.length) {
207                         //    $btn_profile_type.mouseover(function(){
208                         //         console.log('hover');
209                         //     });
210                         // }
211
212                         if ($buttonRadioProfileType.length) {
213                             $buttonRadioProfileType.prop('checked', false);
214
215                             if ($answers_actions_before.length) {
216                                 console.log($answers_actions_before);
217                                 $btn_profile_type.append($answers_actions_before);
218                                 $answers_actions_before.removeClass('hidden');
219                             } else if ($answers_actions.length) {
220                                 $btn_profile_type.append($answers_actions);
221                                 $answers_actions.removeClass('hidden');
222                             }
223
224                             $buttonRadioProfileType.off('click').on('click', function(e) {
225                               var $field_id_ror_technique = $('.form-item-my-level-id-ror-technique-sheet').find('.form-text');
226                               //var this_val_idror = $detailContentTechnique.find('.actions').attr('data-idror-technique');
227                               //$('input[name="my_level_sheet"]').val(1);
228                               //$(this).prop('checked', true);
229                               //$(this).attr('checked', 'checked');
230                               console.log(id_ror);
231                               $field_id_ror_technique.attr('value',id_ror).val(id_ror);
232                           });
233                         }
234                      }
235                    });
236                }
237            });
238
239            $modal_technique_close.off('click').on('click', function(e){
240                // $('#modal--culinary-profile').modal('hide');
241                var oldPlayer = $('.video-technique').find('video').attr('id');
242                console.log(oldPlayer);
243                videojs(oldPlayer).dispose();
244                $('.modal.in').modal('hide');
245            });
246
247        }
248
249        this.goBack = function goBack() {
250          window.history.back();
251        }
252
253    } //attach
254  }; // behaviors
255
256}(jQuery));
257
258// (function(window, videojs) {
259//   var player = window.player = videojs('video-technique');
260//
261//   // hook up the video switcher
262//   var loadUrl = document.getElementById('load-url');
263//   var url = document.getElementById('url');
264//   loadUrl.addEventListener('submit', function(event) {
265//     event.preventDefault();
266//     player.src({
267//       src: url.value,
268//       type: 'application/x-mpegURL'
269//     });
270//     return false;
271//   });
272// }(window, window.videojs));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.