Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. I'm not realy in to this. Not a great programmer here. But if I check ModuleJS, the "parent" of JqueryWireTabs there you see: public function init() { $class = $this->className(); $info = $this->getModuleInfo(); $version = (int) $info['version']; if(is_file($this->config->paths->$class . "$class.css")) $this->config->styles->add($this->config->urls->$class . "$class.css?v=$version"); if(is_file($this->config->paths->$class . "$class.js")) $this->config->scripts->add($this->config->urls->$class . "$class.js?v=$version"); } Here the needed styles & scripts are added to the styles & script array. In Ryan example you can see how to loop through those arrays and output them in your template.
  2. Wished, that the JqueryWireTabs also listened to hashes in URLs, so that you could link to a certain tab. --- internal + external links to work with JqueryWireTabs tabs links like: http://pw.local/processwire/page/edit/?id=1#children or [click children](#children) in field descriptions can open tab directly now. p.s. view tab doesn't work. /** * Wire Tabs, jQuery plugin * * Developed by Ryan Cramer for ProcessWire * */ (function($) { $.fn.WireTabs = function(customOptions) { var options = { rememberTabs: config.JqueryWireTabs.rememberTabs, // -1 = no, 0 = only after submit, 1 = always cookieName: 'WireTabs', items: null, skipRememberTabIDs: [], id: '' }; var totalTabs = 0; $.extend(options, customOptions); return this.each(function(index) { var $tabList = $("<ul></ul>").addClass("WireTabs nav"); var $target = $(this); var lastTabID = ''; // ID attribute of last tab that was clicked function init() { if(!options.items) return; if(options.id.length) $tabList.attr('id', options.id); if(options.items.size() < 2) return; options.items.each(addTab); $target.prepend($tabList); var $form = $target; var $rememberTab = null; var cookieTab = getTabCookie(); var hash = capitalize(document.location.hash.replace("#","")); $(".description a[href^=#]").click(function(e){ e.preventDefault(); var thisHash = $(this).attr('href').replace("#",""); var thisHash = "#ProcessPageEdit" + capitalize(thisHash); $tabList.find("a[href$=" + thisHash + "]").click(); }); if(options.rememberTabs == 0) { $form.submit(function() { setTabCookie(lastTabID); return true; }); } if(cookieTab.length > 0 && options.rememberTabs > -1) $rememberTab = $tabList.find("a#_" + cookieTab); if($rememberTab && $rememberTab.size() > 0) { $rememberTab.click(); if(options.rememberTabs == 0) setTabCookie(''); // don't clear cookie when rememberTabs=1, so it continues } else if(hash.length) { $tabList.find("a[href$=" + hash + "]").click(); } else { $tabList.children("li:first").children("a").click(); } } function capitalize(s){ return s.charAt(0).toUpperCase() + s.slice(1); } function addTab() { totalTabs++; var $t = $(this); if(!$t.attr('id')) $t.attr('id', "WireTab" + totalTabs); var title = $t.attr('title') || $t.attr('id'); $t.removeAttr('title'); var href = $t.attr('id'); var $a = $("<a></a>") .attr('href', '#' + href) .attr('id', '_' + href) // ID equal to tab content ID, but preceded with underscore .html(title) .click(tabClick); $tabList.append($("<li></li>").append($a)); $target.prepend($t.hide()); } function tabClick() { var $oldTab = $($tabList.find("a.on").removeClass("on").attr('href')).hide(); var $newTab = $($(this).addClass('on').attr('href')).show(); var newTabID = $newTab.attr('id'); var oldTabID = $oldTab.attr('id'); // add a target classname equal to the ID of the selected tab // so there is opportunity for 3rd party CSS adjustments outside this plugin if(oldTabID) $target.removeClass($oldTab.attr('id')); $target.addClass(newTabID); if(options.rememberTabs > -1) { if(jQuery.inArray(newTabID, options.skipRememberTabIDs) != -1) newTabID = ''; if(options.rememberTabs == 1) setTabCookie(newTabID); lastTabID = newTabID; } return false; } function setTabCookie(value) { document.cookie = options.cookieName + '=' + escape(value); } function getTabCookie() { var regex = new RegExp('(?:^|\\s?' + options.cookieName + '=(.*?)(?:;|$)','i'); var match = document.cookie.match(regex); match = match ? match[1] : ''; return match; } init(); }) } })(jQuery);
  3. I think to set no limit to the files, and solve the 'max' files within the template. Explain next to the field how high the max showed images are on the front. Then the left over images is some sort of storage/changeable
  4. IMPRESSIVE ! great work Horst .
  5. Same here kongondo. To manny open projects / no time to finish. I hope i will get time to finish my mailchimp field type.
  6. Love the text on your site kongondo.
  7. The problem is scalability. Putting them on top wil give performance issues as it has to reassign the index for all siblings.
  8. @diogo, Have used that coffee "machine". Makes great Coffee ! To go back on topic, maybe we should listen to coffee music.
  9. For PHP I use http://php-osx.liip.ch/ It uses the Apache installation, which comes with OS X. I use this for many many years now and it works great, whitout a problem. (Although i'm not a terminal guy)
  10. Maybe you can get InputfieldPageName module to the site/modules/ folder and change the JS name behaviour. ( making the name fields javascript remove the / an / a / ) $title = "The tralalala"; $title = trim(preg_replace("/^(the¦a¦an)\b\ */i", "", $title)); $iLookLikeName = $sanitizer->pageName($title); $pages->find("name=$iLookLikeName, sort=name");
  11. @OllieMackJames Take a look at Nik's module: SelectorTest , here you can play with selectors. You can quickly test if the selectors work. Can't thank Nik enough for this beautiful module.
  12. Welcome, Pw2.3 is responsive by default. And yes you can delete the install folder.
  13. @wanze: you're right. (Think pw ads _1 on the end when exist) I thought to save it without name & then re-save it with page id as name with some string adition. Then you're name is always unique & easy querying. (On mobile, not able to test)
  14. Can imagine, sort of.....
  15. Write some instructions is the only way I believe. In the template file, just "break" the loop or slice your array. When you use repeaters, you'll never use hundreds of them so the overhead is minimum.
  16. quote: I'm not quite sure what you mean the difference to be between 'close the browser' and 'completely quit the browser'? On the mac, if you close all browser windows, you don't quit the browser.
  17. For the Dutch law: For techincal needed cookes ( shopping baskets, loggin forms etc ) you don't need to give cookie permission.
  18. Hai Peter, you said: "I guess it depends on the business requirements of a particular website." (If I understand what you're saying) If you don't "trust" your editors, you're better off with with a front-end edit solution with the PW API.
  19. Hello Peter, If the traffic lights are turned red, you could drive through. But you know you're wrong. If there's an emergency, you could take the risk to driving through red. ( soft lock. ) But if there's a hard lock, the lock must be openend somehow if someone didn't logout for example. So an other thing is needed to re-open locked pages. ( Making the hard-lock a little soft again. ) Think Soma did a great job with the soft-lock.
  20. Love it !
  21. Herzlich willkommen Andy.
  22. So far I know, proCache doesn't rely on PHP but uses dynamic htaccess to call static pages. ( Have not used proCache )
  23. fields in the (folder) - data1 ( populateted with the header value "color" forexample ) - data2 ( populateted with the header value "size" forexample ) - data3 ( populateted with the header value "amount" forexample ) - data4 ( not set ) if you know, that data4 is false, then you don't have to get data4 field from it's children. ( This way, you're able to have a three column table )
×
×
  • Create New...