Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

admin.js

Zuletzt modifiziert: 02.04.2025, 15:01 - Dateigröße: 6.55 KiB


001  /**
002  * phpBB3 ACP functions
003  */
004   
005  /**
006  * Parse document block
007  */
008  function parse_document(container)
009  {
010      var test = document.createElement('div'),
011          oldBrowser = (typeof test.style.borderRadius == 'undefined');
012   
013      delete test;
014   
015      /**
016      * Navigation
017      */
018      container.find('#menu').each(function() {
019          var menu = $(this),
020              blocks = menu.children('.menu-block');
021   
022          if (!blocks.length) {
023              return;
024          }
025   
026          // Set onclick event
027          blocks.children('a.header').click(function() {
028              var parent = $(this).parent();
029              if (!parent.hasClass('active')) {
030                  parent.siblings().removeClass('active');
031              }
032              parent.toggleClass('active');
033          });
034   
035          // Set active menu
036          menu.find('#activemenu').parents('.menu-block').addClass('active');
037   
038          // Check if there is active menu
039          if (!blocks.filter('.active').length) {
040              blocks.filter(':first').addClass('active');
041          }
042      });
043   
044      /**
045      * Responsive tables
046      */
047      container.find('table').not('.not-responsive').each(function() {
048          var $this = $(this),
049              th = $this.find('thead > tr > th'),
050              columns = th.length,
051              headers = [],
052              totalHeaders = 0,
053              i, headersLength;
054   
055          // Find columns
056          $this.find('colgroup:first').children().each(function(i) {
057              var column = $(this);
058              $this.find('td:nth-child(' + (i + 1) + ')').addClass(column.prop('className'));
059          });
060   
061          // Styles table
062          if ($this.hasClass('styles')) {
063              $this.find('td:first-child[style]').each(function() {
064                  var style = $(this).attr('style');
065                  if (style.length) {
066                      $(this).parent('tr').attr('style', style.toLowerCase().replace('padding', 'margin')).addClass('responsive-style-row');
067                  }
068              });
069          }
070   
071          // Find each header
072          if (!$this.data('no-responsive-header'))
073          {
074              th.each(function(column) {
075                  var cell = $(this),
076                      colspan = parseInt(cell.attr('colspan')),
077                      dfn = cell.attr('data-dfn'),
078                      text = dfn ? dfn : $.trim(cell.text());
079   
080                  if (text == ' ') text = '';
081                  colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
082   
083                  for (i=0; i<colspan; i++) {
084                      headers.push(text);
085                  }
086                  totalHeaders ++;
087   
088                  if (dfn && !column) {
089                      $this.addClass('show-header');
090                  }
091              });
092          }
093   
094          headersLength = headers.length;
095   
096          // Add header text to each cell as <dfn>
097          $this.addClass('responsive');
098   
099          if (totalHeaders < 2) {
100              $this.addClass('show-header');
101              return;
102          }
103   
104          $this.find('tbody > tr').each(function() {
105              var row = $(this),
106                  cells = row.children('td'),
107                  column = 0;
108   
109              if (cells.length == 1) {
110                  row.addClass('big-column');
111                  return;
112              }
113   
114              cells.each(function() {
115                  var cell = $(this),
116                      colspan = parseInt(cell.attr('colspan')),
117                      text = $.trim(cell.text());
118   
119                  if (headersLength <= column) {
120                      return;
121                  }
122   
123                  if ((text.length && text !== '-') || cell.children().length) {
124                      if (headers[column].length) {
125                          cell.prepend($("<dfn>").css('display', 'none').text(headers[column]));
126                      }
127                  }
128                  else {
129                      cell.addClass('empty');
130                  }
131   
132                  colspan = isNaN(colspan) || colspan < 1 ? 1 : colspan;
133                  column += colspan;
134              });
135          });
136   
137          // Remove <dfn> in disabled extensions list
138          $this.find('tr.ext_disabled > .empty:nth-child(2) + .empty').siblings(':first-child').children('dfn').remove();
139      });
140   
141      /**
142      * Hide empty responsive tables
143      */
144      container.find('table.responsive > tbody').each(function() {
145          var items = $(this).children('tr');
146          if (!items.length)
147          {
148              $(this).parent('table:first').addClass('responsive-hide');
149          }
150      });
151   
152      /**
153      * Fieldsets with empty <span>
154      */
155      container.find('fieldset dt > span:last-child').each(function() {
156          var $this = $(this);
157          if ($this.html() == '&nbsp;') {
158              $this.addClass('responsive-hide');
159          }
160   
161      });
162   
163      /**
164      * Responsive tabs
165      */
166      container.find('#tabs').not('[data-skip-responsive]').each(function() {
167          var $this = $(this),
168              $body = $('body'),
169              ul = $this.children(),
170              tabs = ul.children().not('[data-skip-responsive]'),
171              links = tabs.children('a'),
172              item = ul.append('<li class="tab responsive-tab" style="display:none;"><a href="javascript:void(0);" class="responsive-tab-link">&nbsp;</a><div class="dropdown tab-dropdown" style="display: none;"><div class="pointer"><div class="pointer-inner"></div></div><ul class="dropdown-contents" /></div></li>').find('li.responsive-tab'),
173              menu = item.find('.dropdown-contents'),
174              maxHeight = 0,
175              lastWidth = false,
176              responsive = false;
177   
178          links.each(function() {
179              var link = $(this);
180              maxHeight = Math.max(maxHeight, Math.max(link.outerHeight(true), link.parent().outerHeight(true)));
181          })
182   
183          function check() {
184              var width = $body.width(),
185                  height = $this.height();
186   
187              if (!arguments.length && (!responsive || width <= lastWidth) && height <= maxHeight) {
188                  return;
189              }
190   
191              tabs.show();
192              item.hide();
193   
194              lastWidth = width;
195              height = $this.height();
196              if (height <= maxHeight) {
197                  responsive = false;
198                  if (item.hasClass('dropdown-visible')) {
199                      phpbb.toggleDropdown.call(item.find('a.responsive-tab-link').get(0));
200                  }
201                  return;
202              }
203   
204              responsive = true;
205              item.show();
206              menu.html('');
207   
208              var availableTabs = tabs.filter(':not(.activetab, .responsive-tab)'),
209                  total = availableTabs.length,
210                  i, tab;
211   
212              for (i = total - 1; i >= 0; i --) {
213                  tab = availableTabs.eq(i);
214                  menu.prepend(tab.clone(true).removeClass('tab'));
215                  tab.hide();
216                  if ($this.height() <= maxHeight) {
217                      menu.find('a').click(function() { check(true); });
218                      return;
219                  }
220              }
221              menu.find('a').click(function() { check(true); });
222          }
223   
224          phpbb.registerDropdown(item.find('a.responsive-tab-link'), item.find('.dropdown'), {visibleClass: 'activetab', verticalDirection: 'down'});
225   
226          check(true);
227          $(window).resize(check);
228      });
229  }
230   
231  /**
232  * Run onload functions
233  */
234  (function($) {
235      $(document).ready(function() {
236          // Swap .nojs and .hasjs
237          $('body.nojs').toggleClass('nojs hasjs');
238   
239          // Focus forms
240          $('form[data-focus]:first').each(function() {
241              $('#' + this.getAttribute('data-focus')).focus();
242          });
243   
244          parse_document($('body'));
245   
246          $('#questionnaire-form').css('display', 'none');
247          var $triggerConfiglist = $('#trigger-configlist');
248   
249          $triggerConfiglist.on('click', function () {
250              var $configlist = $('#configlist');
251              $configlist.closest('.send-stats-data-row').toggleClass('send-stats-data-hidden');
252              $configlist.closest('.send-stats-row').find('.send-stats-data-row:first-child').toggleClass('send-stats-data-only-row');
253              $(this).find('i').toggleClass('fa-angle-down fa-angle-up');
254          });
255   
256          $('#configlist').closest('.send-stats-data-row').addClass('send-stats-data-hidden');
257   
258          // Do not underline actions icons on hover (could not be done via CSS)
259          $('.actions a:has(i.acp-icon)').mouseover(function () {
260              $(this).css("text-decoration", "none");
261          });
262      });
263  })(jQuery);
264