CaelanStewart

Members
  • Content count

    37
  • Joined

  • Last visited

Community Reputation

31 Excellent

About CaelanStewart

  • Rank
    Jr. Member

Recent Profile Visitors

933 profile views
  1. CaelanStewart

    Yeah, Ben C was referring to a post about four or five about his. This one to be precise:
  2. CaelanStewart

    I had the same issue, how did you fix it? EDIT: Nevermind, found it. Cheers.
  3. CaelanStewart

    It's because the events are being triggered too early, before the Color Picker's HTML is even added to the DOM, and also the event was missing for the standard repeater (which I've added). This version of InputfieldColorPicker.js is working now. I can't confirm it works for the repeater matrix, but if the class names used in the JS code above are correct, it should just work. I also added safeguards so that multiple events are not applied to the same elements. /** * An Inputfieldtype for handling Colors * used by the FieldtypeColorPicker/InputfieldColorPicker * * created by Philipp "Soma" Urlich * ColorPicker jQuery Plugin by http://www.eyecon.ro/colorpicker/ * * Licensed under LGPL3 http://www.gnu.org/licenses/lgpl-3.0.txt * */ function initColorPicker() { $('div[id^=ColorPicker_]:not(.color-picker-init)').addClass('color-picker-init').each(function(){ var $colorpicker = $(this); $colorpicker.ColorPicker({ color: $(this).data('color').toString(), onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { $colorpicker.css('backgroundColor', '#' + hex); $colorpicker.css('background-image', 'none'); $colorpicker.next('input').val(hex).trigger('change'); } }); }); $('a.ColorPickerReset:not(.color-picker-init)').addClass('color-picker-init').on('click',function(e){ e.preventDefault(); var color = $(this).data('default') && $(this).data('default') != 'transp' ? '#' + $(this).data('default').toString() : 'transparent'; $(this).parent().find('input').val($(this).data('default')).trigger('change'); $(this).parent().find('div[id^=ColorPicker_]').ColorPickerSetColor($(this).data('default').toString()); $(this).parent().find('div[id^=ColorPicker_]') .css('backgroundColor', color) .css('background-image', 'none') .attr('data-color', $(this).data('default').toString()); if(color == 'transparent') { var modurl = $(this).data('modurl'); $(this).parent().find('div[id^=ColorPicker_]') .css('background-image', 'url(' + modurl + 'transparent.gif)'); } }); /* additions (swatches) by @Rayden */ $('div.ColorPickerSwatch:not(.color-picker-init)').addClass('color-picker-init').on('click',function(e){ e.preventDefault(); var color = $(this).data('color') && $(this).data('color') != 'transp' ? '#' + $(this).data('color').toString() : 'transparent'; $(this).closest('.ui-widget-content, .InputfieldContent').find('input').val($(this).data('color')).trigger('change'); $(this).closest('.ui-widget-content, .InputfieldContent').find('div[id^=ColorPicker_]').ColorPickerSetColor($(this).data('color').toString()); $(this).closest('.ui-widget-content, .InputfieldContent').find('div[id^=ColorPicker_]') .css('backgroundColor', color) .css('background-image', 'none') .attr('data-color', $(this).data('color').toString()); if(color == 'transparent') { var modurl = $(this).closest('.ui-widget-content, .InputfieldContent').find('.ColorPickerReset').data('modurl'); $(this).closest('.ui-widget-content, .InputfieldContent').find('div[id^=ColorPicker_]') .css('background-image', 'url(' + modurl + 'transparent.gif)'); } }); } $(function(){ /** * Looks like its due to events being fired too early. */ function delayedInit(event) { console.log(event.type); setTimeout(initColorPicker, 500); setTimeout(initColorPicker, 1000); } $(document).on('opened', '.InputfieldRepeaterItem', delayedInit); $(document).on('repeateradd', '.InputfieldRepeater .InputfieldRepeaterAddLink', delayedInit); $(document).on('repeateradd', '.InputfieldRepeaterMatrix .InputfieldRepeaterMatrixAddLink', delayedInit); initColorPicker(); }); Hope that helps.
  4. CaelanStewart

    I've found a bug in this module, if you set the field's settings to be closed when populated, you must trigger a resize event in order for the map to render when the field is expanded after the field has been populated and saved.
  5. I see, it's that simple! I did look at the docs (even that page), but I missed that part. Cheers.
  6. Hi All, I developed a module for ProcessWire for a project I've been working on for a School's Football Association. It's a website for them to list all of the competitions, rounds, fixtures and results etc. All of these are separated into yearly seasons, and each season is to contain a standard page structure, which the module creates. This module creates a page in the Admin for the seasons to be added from. Now, that's fine, it works, but now we're creating the client accounts with minimal permissions, it seems that only super users can access the page that was created by the module upon install. This page is created from the module's info array, like so: public static function getModuleInfo() { return [ ... 'page' => [ 'name' => 'season', 'title' => 'Add Season', 'permission' => 'season-add' // This did not work ] ... ]; } What I'd like to know, is how I can set the permissions for that page, and allow non-super users to see it in the admin nav and access the page. The page created is of the template 'admin', which I tried applying permissions to for the role created by the module, but that also did not work. The method I tried on the line with the "this did not work" comment was from the comments in the code in /wire/core/Process.php.
  7. CaelanStewart

    @horst, I thought I'd share my implementation of an auto-watermarking module. This module depends on PIM, and also depends on some other stuff specific to the application the module was created for. If anybody wants to use this module for their own uses, you'll have to change the names of fields and templates that you want to apply a watermark to. We (PROGRESS: A Creative Agency) do plan to modify this module for more general use in future, and release it in the module directory. But we are really busy right now, and cannot do so. See the GitHub gist here.
  8. CaelanStewart

    Wow, thanks! Good to see active and responsive development! Though, unfortunately, I had avoided the need to get the variations. At least the next guy won't have an issue! Yes, I'm secretly spying on everything you do! I knew!
  9. CaelanStewart

    @horst, hi there. I wrote the code I posted specifically for this thread - the prefix is present in the actual code. Perhaps you could add an option to disable the caching of variations, or perhaps add a parameter to the getPimVariations() method that ignores the cache, like so? $pim = $page->image->pim2Load('some-prefix'); $pim->getPimVariations(true); // Passing true skips the cache
  10. CaelanStewart

    @horst, an excellent module for ProcessWire, I'm glad that I now have the opportunity to use it in a practical setting. Though, I have encountered some issues, and though I have found workarounds, I thought I'd still make them known here, in case you did not know. So, I've been creating a system that hooks after the pageSave event, applies a watermark to images in a specific field, and overwrite the original file with it. Along the way, I've noticed the following problems: getPimVariations() does not include any images created and saved with Pim2 unless I reload the page: $pim = $image->pim2Load('watermark'); print $pim->getPimVariations()->count; // prints '0', expected '0' $pim->watermarkLogo($somePageimage, 'center', 5)->pimSave(); print $pim->getPimVariations()->count; // prints '0', expected '1' This also happens: // Call pim on image with existing pim variations $pim = $image->pim2Load(); print $pim->getPimVariations()->count; // prints '1', expected '1' $pim->removePimVariations(); print $pim->getPimVariations()->count; // prints '1', expected '0' I tried to get around the above error by calling pim2Load() on the image again, after calling pimSave(), to see if that'd work, and it caused some kind of infinite loop, or whatever - I had to restart the severs: $pim = $image->pim2Load(); print $pim->getPimVariations()->count; // prints '0', expected '0' $pim->watermarkLogo($watermark, 'center', 5)->pimSave(); $pim = $image->pim2Load(); // Causes max_execution_time timeout print $pim->getPimVariations()->count; // doesn't execute, expected '1' Am I doing something wrong? If I am, I think it may be prudent for you to make clear the limitations of your module.
  11. CaelanStewart

    Added some more info and sites...
  12. CaelanStewart

    I was not aware of this section's existence, and since I've submitted a number of sites to the site submission page, I thought it may be good to post them here, too. So, over the past couple of years I've been using ProcessWire, I've had the opportunity to build a decent number of ProcessWire websites. I initially didn't like the idea of using ProcessWire when I was first required to use it, but I soon came regret even thinking that - ProcessWire is now my favourite CMS! Here are some sites where I've been the primary/sole developer (I must say, I did not design these sites, I just turned the designer's visions into reality: PROGRESS: A Creative Agency This is the second iteration of the company I work for's website. it was built to reflect our amended brand identity and scope as an agency. Hilton Extraordinary F&B This website is access only, so you will be unable to see the site in action, however, I have linked to our case study on our website which has some screenshots. Note that the app is being discontinued, since they want a single sign on system. So for one, it just wasn't going to be simple to do the SSO system on the app. And two, the app was kind of pointless anyway, and they just fell for the old "we need an app for that", when a responsive website is just fine for their needs. The Extraordinary F&B site also protects many important static files by restricting access to them, and using Apache X-SendFile to allow access to them when the user is authorised. TY Logistics This website is four a courier company based in the UK. The animating lines was fairly challenging, but I got there in the end. The animating lines work by generating an SVG path string on the fly, using various elements as reference points, setting the stroke-dasharray and stroke-dashoffset to the path length, and then animating stroke-dashoffset to zero. It utilises ScrollMagic for managing the scroll-based animations. Guy Hollaway Architects This website was built for an architects based in London and Hythe, UK. Folkestone Harbour Arm This was created to list events and information about the newly refurbished and converted Harbour Arm in Folkestone, United Kingdom. Unfortunately, there are no events on the site right now, which makes some areas look rather bare. However, there is a screenshot available on the page for this site on the sites directory. Visit Romney Marsh This was a budget-wise project to promote the Romney Marsh in the south-east of England. It features a Google Maps integration for the listing of attractions and accommodation. And has another, very similar map for events on and around the Romney Marsh. Hythe Care Homes This has to be one of the coolest care home websites I've seen! We developed a site for Hythe Care Homes, a care business consisting of three separate homes for old-aged people. More to come soon when I have time. On my lunch break right now, you see.
  13. CaelanStewart

    You were close, the default PW installation set the 'created' column value (not the default value) to 0000-00-00 for the home, admin, page, add and other default PW pages that come with the PW install. I changed all of those to some other date before the modified date for each of those rows, and the update ran perfectly. The version first used for this PW site is 2.5, so maybe MySQL removed support for zero-dates, and that's why it cropped up now. But I haven't touched those columns/rows and only AIOM plugin has been installed.
  14. CaelanStewart

    Small update: I had pasted the queries into the wrong areas in phpMyAdmin, so I had thought it had executed successfully none of them had actually been executed. I have a PHP error when I publish a page now.
  15. CaelanStewart

    Hi, Upon upgrading a site from 2.6.1 to 2.7.2 (latest stable), Update #12 fails with an SQL error: I narrowed it down to this query (SystemUpdate12.php): ALTER TABLE pages ADD published datetime DEFAULT NULL AFTER `created_users_id` The strange thing comes now: the error only seems to arise when PHP executes the query with the PW's DB class. I executed the queries in SystemUpdate12.php manually in phpMyAdmin and, and force update 12 to return true in the 'update' method of the SystemUpdater class and the other updates ALL worked seamlessly, only that one was an issue. PW seems to be functioning fine, too. EDIT: Turns out I was a silly sod and didn't paste the queries in the right place in phpMyAdmin, and I had though they'd executed when they actually hadn't. So when I pasted the above query in the correct place in phpMyAdmin, I got the same error as I did in PW: I tried repairing the table, before I tried the above and that had no effect. The installation has no other plugins (other than AllInOne Minify) or modifications to the 'pages' table. Bit of a weird issue, but I got it working pretty quickly.