Jump to content

interrobang

Members
  • Posts

    255
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by interrobang

  1. I think this would be a useful addition to the Sanitizer class. Something like this should do it: $dotfloat = rtrim(number_format($number,100,'.',''), '.0');
  2. Perfect! Thank you! I have merged your PR.
  3. Thank you! This looks good to me! If you make a PR I will merge and release a new version.
  4. So far I haven't found a fully working regex. My test case is this. You you or anybody else finds a solution a PR is more than welcome. $test = "<h2>Fully URLs</h2>"; $test .= "http://domain.com <br>"; $test .= "http://domain.com/ <br>"; $test .= "http://domain.com/dir <br>"; $test .= "(http://domain.com/dir) <br>"; $test .= "http://domain.com/dir/ <br>"; $test .= "http://domain.com/dir/?a=1 <br>"; $test .= "<h2>www. domains</h2>"; $test .= "www.domain.com <br>"; $test .= "www.domain.com/ <br>"; $test .= "www.domain.com/dir <br>"; $test .= "www.domain.com/dir/ <br>"; $test .= "www.domain.com/dir/?a=1 <br>"; $test .= "<h2>flourishlib Examples</h2>"; $test .= "Example 1: www.example.com.<br>"; $test .= "Example 2: https://example.com.<br>"; $test .= "Example 3: john@example.com.<br>"; $test .= "Example 4: ftp://john:password@example.com.<br>"; $test .= "Example 5: www.example.co.uk.<br>"; $test .= "Example 6: john@example.co.uk.<br>"; $test .= 'Example 7: <a href="http://example.com">http://example.com</a>.'; wireModules("TextformatterMakeLinks")->format($test); echo $test;
  5. Unfortunately, I'm not very good with regex, but I still tried to solve the problem. Can you please give it a try if the result is better if you remove the \b in lines 52 and 53? Has anyone here with more regex experience an idea what problems could arise from this change?
  6. It looks like Safari has a problem with the ui-helper-clearfix class. If you remove it the layout looks ok.
  7. You can add custom classes to the body of the ckeditor iframe. In the field settings (Input Tab) insert this in the "Custom Config Options" field: bodyClass: Inputfield_textarea1 If you need more flexibility you can also hook create a hook in your /sites/init.php to add multiple classes to all of your ckeditor fields: wire()->addHookBefore('Field(inputfieldClass=InputfieldCKEditor)::getInputfield', function(HookEvent $event) { // do not show modified data on Field edit page if ($this->wire('process') != 'ProcessPageEdit') return; $field = $event->object; $page = $this->pages->get($this->input->get->id); $customOptions = $field->customOptions; $customOptions .= "\nbodyClass: template-{$page->template} page-{$page->id} field-{$field->name}"; $field->customOptions = $customOptions; });
  8. Hi Nik, thanks, I am well Honestly I have not used my module myself for a long time, and I still have not looked into what has to be done to migrate this module to PW3 and its new image field. I plan to release a new version eventually, but can't say how long it will take. But seeing somebody still uses it at least motivates me to test it myself in PW3. Sorry, that I cant give you a more satisfying answer. I will post back here after testing.
  9. Thanks for sharing, looks Good. Some nice memories are coming back. Chrom Records was one of my favorite labels back in the 90ies. But I am feeling old now..
  10. Yes, should be possible now, see this blog post for more infos: https://processwire.com/blog/posts/language-access-control-and-more-special-permissions/
  11. Sorry, I have not tested this module in any recent version, but I recommend using the dev version in the thumbnails branch, some minor issues might be fixed there: https://github.com/phlppschrr/ImageFocusArea/tree/thumbnails I have not looked into these new ajax features. Does anybody know of any thread here how to support ajax editing and loading for your own fields? Please continue to report any issues and improvement ideas here (or even better at github). PS: Sorry, for being a bad module maintainer. I still have some plans with this module, but not enough time - too much customer work and a newborn baby at home.
  12. Thanks Martijn! After changing the sanitizeValue method the trailing slash is no longer needed. Field dependencies still don't work, but I did not expect it either Thanks for looking into it, but in my current project I can totally live without it. It's just a "nice to have", and I wanted to give you some feedback.
  13. I am currently using this field for the first time and I love it! Really a useful little time saver! One minor issue I found: I configured the folder path without a trailing slash. When editing a template i could see the files in the folder, but the field never saved the selected value. After adding a trailing slash to the foldername everything worked as expected. I did not see any warnings or errors on screen or in my logs. Another thing I still could not figure out is, how to use this field with showIf field dependencies. Is this even possible? I would like to show some other fields only if a certain file is selected.
  14. Unfortunately I can't help here - I did not understand much of the documentation. Getting to this point was mostly trial and error. I am not even sure if this can be achieved with this file. I think the main purpose of the meta file is to enable type-hinting for static factory methods.
  15. In PhpStorm you can get autocompletion and typehinting for wire function calls if you add a file with the following content somewhere to your project. Jetbrains suggests naming this file '.phpstorm.meta.php' and adding it to the root of your project, but it should work anywhere else too. I had to re-open the project after adding the file. <?php /** * ProcessWire PhpStorm Meta * * This file is not a CODE, it makes no sense and won't run or validate * Its AST serves PhpStorm IDE as DATA source to make advanced type inference decisions. * * @see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata */ namespace PHPSTORM_META { $STATIC_METHOD_TYPES = [ \wire('') => [ '' == '@', 'config' instanceof Config, 'wire' instanceof ProcessWire, 'log' instanceof WireLog, 'notices' instanceof Notices, 'sanitizer' instanceof \Sanitizer, 'database' instanceof \WireDatabasePDO, 'db' instanceof \DatabaseMysqli, 'cache' instanceof \MarkupCache, 'modules' instanceof \Modules, 'procache' instanceof \ProCache, 'fieldtypes' instanceof \Fieldtypes, 'fields' instanceof \Fields, 'fieldgroups' instanceof \Fieldgroups, 'templates' instanceof \Templates, 'pages' instanceof \Pages, 'permissions' instanceof \ Permissions, 'roles' instanceof \Roles, 'users' instanceof \Users, 'user' instanceof \User, 'session' instanceof \Session, 'input' instanceof \WireInput, 'languages' instanceof \Languages, 'page' instanceof \Page, ] ]; }
  16. My editor role can only edit/see non-default languages. Any idea how to enable editing the default language, too? I did not edit the modules in the wire directory, but copied them to my site/modules directory, as I want to update the core in the future.
  17. You have to help PHPStorm to recognize ProcessWires API vars by including a PHPDoc section in your template file. I created a gist for you which includes all (?) available API vars, simply paste this in your template file: https://gist.github.com/phlppschrr/ea81285bdf56b497193b To get even better autocompletion I can recommend the TemplateStubs module
  18. This looks like a great timesaver! Thanks for creating this module. I will try it next week. One minor feature I would like to see added: As I often use forks of modules or custom modules or which are not in the modules directory it would be great if the "list of modules to install" could also contain links to zip files. But also without this addition I think this module will be my new favorite way to install modules when setting up a new site.
  19. @boundaryfunctions Regarding good IDE support I just want to mention that ProcessWire already has Phpdoc-Comments for most of its magic functions. At least in PhpStorm you get all the autocompletion if you tell your IDE which default variables are there. In templates where I want autocompletion I have a comment like this at the beginning of the file: // ============================================================================= // ProcessWire API Variables: /** @var $config Config */ /** @var $log WireLog */ /** @var $notices Notices */ /** @var $sanitizer Sanitizer */ /** @var $modules Modules */ /** @var $fieldtypes Fieldtypes */ /** @var $fields Fields */ /** @var $fieldgroups Fieldgroups */ /** @var $templates Templates */ /** @var $pages Pages */ /** @var $permissions Permissions */ /** @var $roles Roles */ /** @var $users Users */ /** @var $user User */ /** @var $session Session */ /** @var $input WireInput */ /** @var $languages Languages */ /** @var $page Page */ // ============================================================================= // Common used aliases: /** @var $p Page */ /** @var $img Pageimage */ And if you need autocompletion for your custom fields you can use the TemplateStubs module
  20. I did not include any vendor prefixes. If you need to support old browser version you might want to add -moz and -webkit prefixes to background-size. And for IE8 you need a htc-polyfill https://github.com/louisremi/background-size-polyfill And in the future you can use img { object-fit: contain; } But unfortunately this is not ready for primetime: http://caniuse.com/#feat=object-fit
  21. I think you can do this with the PIM module https://processwire.com/talk/topic/4264-release-page-image-manipulator/ The method you are looking for is canvas() Having said that, I would probably do it with css if it is ok for you using a css background-image instead of a normal <img/>. You can position and scale background-images easily with css like this: <style> .slide { background-position: 50% 50%; background-size: contain; background-repeat: no-repeat; } </style> <div class="slides"> <div class="slide" style="background-image: url(img.jpg)">Content Slide 1</div> <div class="slide" style="background-image: url(img.jpg)">Content Slide 2</div> </div>
  22. There are probably some bugfixes in the dev version which I don't remember anymore, but the main difference is you can now setup multiple focusareas. These additional focusareas can be defined with a optional width and height which will be used as a default size. Sorry, all of this is still undocumented and there will probably be some api changes to the module in the future, so I didn't post it here. If the old version is working fine for you just keep using it, and if you want to update to the dev version you can also change the schema in mysql by hand. You just have to change the schema of the focus row to "text" (old schema was varchar(255)) Hope this helps.. If anyone else here wonders where to find my current dev version and wants to play around with it: https://github.com/phlppschrr/ImageFocusArea/tree/thumbnails But be warned, the api is not fixed yet, and I am thinking about a major refactoring.
  23. In ProcessWires index.php you can configure the name of the wire folder: $wireDir = 'wire'; https://github.com/ryancramerdesign/ProcessWire/blob/master/index.php#L77 I doubt Ryan is actively supporting and testing this, but might be worth a try. If you rename your wire-folder you will probably have to adjust some lines in your htaccess too.
  24. @reems This sounds similar to a issue I had recently https://processwire.com/talk/topic/8345-deleting-large-number-of-images-silently-fails/ In my case increasing max_input_vars in my php.ini solved the problem.
  25. Thanks for testing my module. Unfortunately I have urgent client work to do in the moment, but I hope I can do some fixes for this module next week.
×
×
  • Create New...