Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Just fixed a bug with status getting cleaned. So a unpublished page would get published. It just ignores the status now, which isn't something you want to autosave anyway. (There would have to be some special treatment as ProcessPageEdit does)
  2. Your images are only a paths? And where are the pixels?
  3. BTW why is there no autosave in this forum... I lost some long written posts several times during the years.
  4. I pushed an update with default AutoSave only enabled on unpublished pages. Added option to enable it for all pages. That might be true for simple text page with no files. Files and images is what makes it not so simple. And to go further there could be all kind of weird situations wehre you have references to pages that doesn't exists anymore. And so on. It's not like in a nice closed predictable environment like in a audio composing tool (I also use) or a design tool. On the other parts I'm not commenting.
  5. Soma

    I'm back

    Thanks Ryan for your precious time! I'm in awe how you still respond to most posts... I'm sure you missed some, but I'm also loosing control
  6. Yeah that's what I also thought having it only for unpublished pages or also just certain templates. But first wanted to know if it's possible at all to autosave and how. There maybe also a way to save the edits not to the page but to a file and load it on demand after a loss. Im not too keen creating new pages for it. Also I think certain fields like files will not work this way. Speaking of drafts and live version that's something still missing in pw and I would have that on top priority. But Im not in charge of it and it's on the roadmap, though got delayed by a lot. I'm waiting for it since the beginning of using pw two half years ago. ;p Though Im really wondering if with the flexibility pw offers how to use pages and combinations of fields and hooks if a draft system really works out well... if you know what I mean... seeing also things like 'simple' clone feature is not working in all cases. No offend intended, I know Ryan is doing all he can and doing a hell of a job, but he's still "alone" on those stuff.
  7. I know Pete. Exactly, but I didn't ask for it and will not use it cause I can hit save.
  8. Ho Joss, happy new year! Ok that was more helpful than just "it's not saving". Ah, of course ckeditors inline mode need some special treatment. Took me a while to figure it out but it's working now too. Thanks.
  9. Just pushed an update to github with some fix. There were some routines for TinyMCE and CKEDITOR to update the changes to the form before sending, which required some additional check for if there's really editor instances. So this most likely was your problem. Added some additional checking for form validation. So it will show errors of the saved form and show them too. Thanks for testing.
  10. I think I know what's going on. I'm just updating with some fixes and also with additional feature to check for form errors and show them.
  11. What do you mean? It doesn't work for you? I'm using latest PW with new admin theme (although shouldn't matter at all). I don't think this should go as far, and not something that is easily possible.
  12. Just created a new module 'AutoSave' page for the great ProcessWire CMS http://t.co/L3Zp3wz2IX #processwire

  13. AutoSave This module saves the page via ajax when editing in the admin. The interval for saving the page is configurable in the AutoSave module settings. By default it will only be enabled for unpublished pages. So far it seems to work fine for all fields and supports multilanguage. There's a message dialog show on top of page when saving happened with either a success or error. Requirements ProcessWire 2.3+. Haven't really tested with 2.3. Known Issues Nothing really obvious so far. Note that when you have multiple editors editing pages, it would be possible 2 persons editing the same page would overwrite each other, since the page is autosaved! The only solution for this would be to have my PageEditSoftLock module enabled with the complete "Lock" option active, so the page would be locked for editing. Todo Add some checks, if connection is lost. To be defined This module is currently a proof of concept. This module may not be suitable for all instances, but for personal use it may help preventing loss of long edits, most likely blog posts. Not sure this should be used for regular sites with clients editing. Most likely there's some more issues that interferer with what a CMS "page save" has to deal with. So you might find some ugly stuff happening. Thanks to Apeisa and his great Fredi font-end module, from where some logic is borrowed to save the page via ajax. Download https://github.com/somatonic/AutoSave So, that would be my last stroke for this year! Have a great silvester party and a happy new 2014!
  14. $parent = $page->parent; $current = $page->id; $overviewchildren = $parent->children("id!=$current, limit=4"); Or maybe $overviewchildren = $page>siblings("id!=$page, limit=4"); Edit: oh and welcome!
  15. I'm not sure what login you mean but for custom login using $session->login(user,password) you'd have to code it like this: //.. try{ $u = $session->login($username, $pass); if($u && $u->id){ $session->redirect("/somepage/"); } } catch(Exception $e) { echo $e->getMessage(); }
  16. Hanna code just for internal links may a bit cumbersome, but one way to do it. PageLinkAbstractor is an attempt to abstract links to id's, but I'm not sure anymore what it does. I have my own LinkAbstractor for my sites that are mostly multilanguage, and I convert internal links to "pageid:1233" on save and convert them back to a url. Current version of PW and TinyMCE, CKeditor have this feature in now and use language aware links. Thanks to Pete, Ryan and me. ---- Drawback of all this methods is that you can't link from one language to another easily. I guess this is the price to pay when using one page for multiple languages, and this not being the only one. Many features that usually are easy and straight forward become a permanent hassle, cause every feature will need to be considered working for multilanguage too.
  17. You obviously don't know my AdminHotKeys module.
  18. I'm already on a proof of concept thingy as there's already a saveAjax feature in ProcessPageEdit. Though I also think what's so hard to write an article in a text-editor, or just hit "save" once in a while when you write an article that takes time.
  19. There's various threads about what you ask already. Some ways to do it you'll find in my gist examples https://gist.github.com/somatonic/5420536#file-paginator_manual-php As for debugging rendertime you can use Debug class: $rendertime = Debug::timer(); // do your stuff $rendertime = Debug::timer($rendertime); echo "rendertime: $rendertime";
  20. the code is just from the example of the owl json custom data. data["items"] is from the json data. It could also be just data.items. Of course you could use just any methods that works for iterating a object/array. { "items" : [ { "img": "assets/owl1.jpg", "alt" : "Owl Image 1" }, { "img": "assets/owl2.jpg", "alt" : "Owl Image 2" }, { "img": "assets/owl3.jpg", "alt" : "Owl Image 1" }, { "img": "assets/owl4.jpg", "alt" : "Owl Image 2" }, { "img": "assets/owl5.jpg", "alt" : "Owl Image 1" }, { "img": "assets/owl6.jpg", "alt" : "Owl Image 2" } ] }
  21. Not "probably", it will work the way I showed you. I don't think you want to modify the carousel core code, because it works already the way you want. I know how it handles the jsonSuccess and I showed you how to properly use it to call your plugin. If at all I would not make a jquery plugin, but just call a function. This is not the owl support forum nor stack overflow. Sorry can't help you further. Edit: jsonSuccess: $(document).matchCarousel() // call to my plugin matchCarousel.plugin.js This won't ever work but also is not really a problem, as I showed you how to handle it correctly. Looks like you don't understand it anyway. The problem is not the owl core code.
  22. Pretty messy... I would try something like this: (function ($) { $.fn.matchCarousel = function(data, options) { var settings = { 'maxMatches': 10 }; if (options) { $.extend(settings, options); } function customDataSuccess(data) { var counter = 0; for(var i in data["items"]){ var img = data["items"][i].img; var alt = data["items"][i].alt; content += "<img src=\"" +img+ "\" alt=\"" +alt+ "\">" } $("#owl-demo").html(content); }; customDataSuccess(data); } })(jQuery); $(document).ready(function() { $("#owl-demo").owlCarousel({ jsonPath: 'data.json', jsonSuccess: customDataSuccess }); function customDataSuccess(data){ $(document).matchCarousel(data,{ maxMatches: 10}); } }); The callback function jsonSuccess doesn't allow for directly calling your plugin with arguments, but within the callback function you could easily pass "data" and other arguments... Or little simpler and direct $(document).ready(function() { $("#owl-demo").owlCarousel({ jsonPath: '/site/templates/scripts/data.json', jsonSuccess: function(data){ $(document).matchCarousel(data,{ maxMatches: 10}); } }); });
  23. Another thing I noticed is that you use wire(pages) ... wire(session). Which may work, but will throw a notice that it expects wire("pages") or wire("session"). If you would enable debug mode you'd end up with notices all over your site.
  24. Just wanted to mention that redirecting to the 404 page is wrong. wire(session)->redirect("/http404", false); Even if this would be correct... on a side note: the redirect to "/http404" without trailing slash would redirect to "/http404/" (with default settings), and further more if the 404 page uses the basic-page template and the requested page too, you'd end up in endless redirect. Back to why using this is wrong: It won't give you a real 404 page with correct header! It will just redirect to a regular page with content. Means this page will get indexed instead for all pages you're doing this. The way to do it is: throw new Wire404Exception(); This will render the 404 page content with correct header and keep you at the url you requested.
×
×
  • Create New...