CaelanStewart
Members-
Posts
43 -
Joined
-
Last visited
Recent Profile Visitors
1,726 profile views
CaelanStewart's Achievements
Jr. Member (3/6)
36
Reputation
-
Hi, Trying to get spellcheck to work on CKEditor (latest released PW, 3.0.98). I noticed that the spellcheck is no longer working on our website, I'm not sure if it is due to updating to the latest version, bit busy to check right now. But regardless, the spellcheck doesn't work. Kind of. I got it to underline misspelled words with the typical red squiggle by adding the following to the CKEditor config (on field edit UI, 'Input' > 'CKEditor Settings' > 'Custom Config Options') { "disableNativeSpellChecker": false } But, now CKEditor overrides the native right click menu, hiding the browser's correction suggestions. I tried to disable it by entering the following value into the 'Remove Plugins' field under the 'Input' tab on the field edit page for a CKEditor textarea field: image,magicline,liststyle,tabletools,scayt,menubutton,contextmenu The reason for 'liststyle' and 'tabletools' entries, according to a post on Stack Overflow, is so that all dependencies of the `contextmenu` plugin are also disabled. To conclude, I understand that one may use 'CTRL+Right Click' to force display of the native context menu, but to be frank that's not simple enough for a lot of clients. How do I disable the CKEditor context menu and use the browser spellcheck without hindrance. Thanks again.
-
Yeah, Ben C was referring to a post about four or five about his. This one to be precise:
-
I had the same issue, how did you fix it? EDIT: Nevermind, found it. Cheers.
-
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.
-
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.
-
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.
-
CaelanStewart started following Set permissions of page created automatically by module
-
Module Page Image Manipulator | API for 1 & 2
CaelanStewart replied to horst's topic in Modules/Plugins
@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. -
Module Page Image Manipulator | API for 1 & 2
CaelanStewart replied to horst's topic in Modules/Plugins
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! -
Module Page Image Manipulator | API for 1 & 2
CaelanStewart replied to horst's topic in Modules/Plugins
@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 -
Module Page Image Manipulator | API for 1 & 2
CaelanStewart replied to horst's topic in Modules/Plugins
@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. -
Added some more info and sites...
- 1 reply
-
- 2
-
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.
- 1 reply
-
- 14
-
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.
-
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.