Jump to content

Torsten Baldes

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by Torsten Baldes

  1. the way it's bound right now, it will also work, when the element is not yet loaded. basically it says, if someone clicks anywhere on the body, check if the target of the click has a class ".closeplayer". if yes do what you have to do, if no, just carry on. this is what the jQuery documentation says:
  2. looks good and as long as it works … i tried to optimize some things (one could do even more): $(document).ready(function(){ $.ajaxSetup ({ // Disable caching of AJAX responses cache: false }); $('body').on('click', '.openplayer', function() { // delegate bind event event.preventDefault(); // stop the browser from following the link var $this = $(this), // cache selector playerOpenClass = "player-open", // we use this as variable for all other occurences $playerOpen = $("."+playerOpenClass), // cache selector url = $this.attr('href'), divclass = $this.attr('data-class'), $playerDiv = $("#" + divclass), // cache selector buttonclass = $this.attr('id'); // /* Check to see if there is a div with the class player-open If there is, slide it closed, remove its player-open class then move on to the load */ if ($playerOpen.is(':visible')) { $playerOpen.slideUp("slow", function(){ var $this = $(this); $this.empty().removeClass(playerOpenClass); $playerDiv.load(url, function(){ var $this = $(this); $this .hide() .slideDown("slow") .addClass(playerOpenClass); }); }); }else{ /* If there is not a visible div with the class .player-open Then just go ahead with the load */ $playerDiv.load(url, function(){ var $this = $(this); $this .hide() .slideDown("slow") .addClass(playerOpenClass); }); } }) //end openplayer .on('click', '.closeplayer', function() { // delegate bind close event $playerOpen.slideUp("slow", function(){ var $this = $(this); $this .empty() .hide() .removeClass("player-open"); }) }); }); i just edited, but didn't test it, so beware of typos.
  3. yeah, i realized, that this was a bad idea. right now, i'm working on a module based on the lazycron.module, which seems to also work with cached pages/templates. so i think, i found my solution. thanks!
  4. Yes, I thought about ajax, but I do not like the detour. This way i have to send all the needed data (page-id, referer, action, submitted form etc.) via ajax. I hoped for a better way (e.g. a hook, which get's called regardless of cache) to do this. Is there a better way to setup this hook, instead if doing this in a template?
  5. Hi, i want to build a simple tracking system, where i can see how the users navigate through my site. Right now i insert a row in a custom db-table with a unique id, the page a user visits, the page the user came and a timestamp. I do this with a after-hook to »ProcessPageView:finished«, which is setup in an _init.php template which is prepend to any other template. This works fine. The problem is that this doesn't work on cached templates/pages. How can I use the template-cache-feature AND update my db-table via this hook or any other technique? Thanks!
  6. RT @theBikeFaerie: Worst designed garment of clothing in the history of the human race http://t.co/LVbsBVv0r7

  7. done: https://github.com/ryancramerdesign/ProcessWire/issues/662
  8. Oh, i forgot this to add to my post: It's the latest DEV version: ProcessWire 2.4.18 dev
  9. Hi this is maybe a small bug, but a huge inconvenience. I have a repeater field with two text fields and a page field. When i add 2 or more rows (it's set up to prepare 5 rows at the start) and fill them with content (input text and select pages in the page field) it only saves the selected pages of the first page field and not the others. The text fields are fine an get saved as expected. Only the page fields from the second on are blank. When i look at the headers of the saving POST request, i see that the data (page ids for all the fields) get send to the server. What happens after that and where they get lost is out of my knowledge … If i refill the empty page fields and save again, they get saved without problems … I don't know if it's an issue with the repeater or the page fields but it's driving me and the others editors mad. It takes some time to find and select multiple pages and after saving, the fields are empty again. What can i do? Thanks. ps: Yes I have to use Repeater for this. PageTable is not an option.
  10. Today I stumbled over an issue regarding the iFrame-overlay-preview in Modules Manager. The Processwire site now sends an "X-Frame-Options: SAMEORIGIN" header, which breaks the preview function: http://cl.ly/image/0T2F462J0n1c
  11. Also so, wie das #Apple-Event heute gehyped wird, haben die wahrscheinlich Steve Jobs geklont.http://t.co/MwIoLKYYhp

  12. done. https://github.com/ryancramerdesign/ProcessWire/issues/641
  13. I'm about to build a search function for a site and noticed, that search queries/selectors with FieldCache and umlauts don't work. e.g. headline = "Steak mit Käse"; fieldcachefield includes headline field If I search for "Steak" i get the right result. If I search for "Käse" i get nothing. here's my code: if($q = $sanitizer->selectorValue($input->get->q)) { $input->whitelist('q', $q); $matches = $pages->find("fieldcachefield%=$q"); } In the db table for this fieldcache-field all the umlauts are encoded like this K\u00e4se If I use headline as selector, the right result pops up. What could i do, to use FieldCache with umlauts? Thanks!
  14. RT @bdkjones: CodeKit 2.1.4 is now live. Source maps for Stylus + http://t.co/vP3AL2TrYz built-in + lots of updates --> http://t.co/PgEokfX…

  15. Nie war ein Hashtag passender …“@DFB_Team: … und jetzt macht Di Maria auch noch das 4:0. #4gefühl”

  16. nice module/feature! i use PageTable for the same kind of modular content building. how do you render your PageTable templates in the frontend? thanks!
  17. @videokid thanks. i know how to resize an image in processwire. i want to resize the cropped (via thumbnails module) version of an image. since the thumbnails module just returns the image url, i can't use any of the native pw image api methods.
  18. @videokid thanks for your reply! the way you suggest is the way i do it right now. these are my sizes: small, 480,270 medium, 960,540 full, 1200,675 what i want is, that i just crop the largest version and then resize this cropped version proportional to smaller sizes, leaving me with only one size (full, 1200,675) to crop instead of three.
  19. hi there! I couldn't find any information about this in the 18 pages of this thread, so I'll ask you guys: Is it possible to resize a cropped image with the pw-size-functions? I have a header image (4:3, 1200*900) which is cropped with the thumbnails module to 16:9 (1200*675). for smaller screen-resolutions i just need some resized versions of the cropped image. right now i have to crop every version by hand. i would love to use something like this $page->header->getThumb('crop')->width(600); Is this somehow possible? Thanks!
  20. Thanks Martijn! This seems like a good way to do it. Will try that in the next days.
  21. thanks for your reply! this is the way we do it right now. but as we grow and produce more and more pages, this gets slowly a mess with moving the pages back and forth in the right place and other editors finding them. so we thought, there must be a better way to do this.
×
×
  • Create New...