tpr

AdminOnSteroids

Recommended Posts

9 minutes ago, tpr said:

Upgrade time! :)

You are a freaking star! This is brilliant! Love the implementation as well.

This is why open source rocks - I owe you several beers (or other beverage of choice) for this one!

Seriously made my day - client meeting in the morning and this is going to make things so much better.

 

  • Like 1

Share this post


Link to post
Share on other sites

Nice to hear that. I see some parts that could be improved but I think it's usable as it is now. 

  • Like 2

Share this post


Link to post
Share on other sites

Hi,

If I look at the browser source code of my admin, there is a red line, which might have to do with AOS:

<a href="/~theo/pwtest/processwire/module/edit?name=AdminOnSteroids&toggle=1" class="aos_toggle"style="opacity: 0.75; color: inherit !important; margin-left: 0; display: inline-block; padding: 4px 0; margin-right: 1px;"><i class="fa fa-medkit"></i> <span onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'">
Disable AdminOnSteroids</span></a>

 

A space is missing between class and style

class="aos_toggle"style=

Thank you.

Share this post


Link to post
Share on other sites

Thanks, will fix that, although I don't see this (at least in Chrome). I think auto format code went wrong.

Share this post


Link to post
Share on other sites

Thank you.

Chrome doesn't highlight these problems, but it's the same there of course.

Firefox does that, which is pretty handy.

aos.png.dd325f58dba9a5db4026c3e6608190d8.png

Share this post


Link to post
Share on other sites

Latest v1.8.3 further improves checkAllCheckboxes feature. Now its state properly corresponds to individual checkbox changes and also fires a change event (without that showIf fields wouldn't react).

  • Like 3

Share this post


Link to post
Share on other sites

Hey @tpr would it be possible to apply the AOS tweaks for ckeditor also to the frontend editor? Here for example I have the lightwire skin + justify plugin and that does not show up on frontend:

5aacf1e16e703_2018-03-1711_45_30-energieguru.at-beruns.thumb.png.c2abc06f24139de5e9a10e90e8c1b3ea.png5aacf1e30423f_2018-03-1711_44_49-EditPage_berunsenergieguru_to.png.ac595672f70a7684fc8d770e8210df64.png

Share this post


Link to post
Share on other sites

Currently no, aos is loaded only in the admin and I think it would really mess things up if I would change that. 

What would be possible to create another module that would use aos functions and settings but of course aos would also need some refact. I would happily assist in this if someone would take up the challenge. 

  • Like 2

Share this post


Link to post
Share on other sites

@tpr How can I change the font which is used in CodeMirror?

I would like sth. like Courier instead of Arial.

Thank you.

 

EDIT: OK, found it myself.

Adding this:

html.aos .cke_reset_all .CodeMirror-scroll *{font-family:courier!important;font-size:14px;}

to the theme css (One of the files in /site/modules/AdminOnSteroids/CKE/plugins/codemirror/theme/)  does that.

Here is my own theme (theo.css)
 

Spoiler

 


.cm-s-theo span.cm-meta { color: #FF1717; }
.cm-s-theo span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
.cm-s-theo span.cm-atom { color: #219; }
.cm-s-theo span.cm-number { color: #164; }
.cm-s-theo span.cm-def { color: #00f; }
.cm-s-theo span.cm-variable { color: black; }
.cm-s-theo span.cm-variable-2 { color: #0000C0; }
.cm-s-theo span.cm-variable-3 { color: #0000C0; }
.cm-s-theo span.cm-property { color: black; }
.cm-s-theo span.cm-operator { color: black; }
.cm-s-theo span.cm-comment { color: #3F7F5F; font-style:italic;}
.cm-s-theo span.cm-string { color: #555; }
.cm-s-theo span.cm-string-2 { color: #f50; }
.cm-s-theo span.cm-qualifier { color: #555; }
.cm-s-theo span.cm-builtin { color: #30a; }
.cm-s-theo span.cm-bracket { color: #cc7; }
.cm-s-theo span.cm-tag { color: brown;}
.cm-s-theo span.cm-attribute { color: #00c; }
.cm-s-theo span.cm-link { color: #219; }
.cm-s-theo span.cm-error { color: #f00; }

.cm-s-theo .CodeMirror-activeline-background { background: #e8f2ff; }
.cm-s-theo .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; }

html.aos .cke_reset_all .CodeMirror-scroll *{font-family:"Source Code Pro",Courier;font-size:13px;}

.cke_dialog_contents_body .cke_dialog_ui_text, .cke_dialog_contents_body .cke_dialog_ui_select, .cke_dialog_contents_body .cke_dialog_ui_hbox_last > a.cke_dialog_ui_button {
    margin-top:0px;
}

 

 

Share this post


Link to post
Share on other sites

thank you. Totally makes sense, I'll install the plugins manually :) 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, theo said:

to the theme css (One of the files in /site/modules/AdminOnSteroids/CKE/plugins/codemirror/theme/)  does that.

You should better add a new css file with assetpaths and add your rules there instead changing module files. 

Share this post


Link to post
Share on other sites
4 minutes ago, tpr said:

You should better add a new css file with assetpaths and add your rules there instead changing module files. 

Thank you.

I've made my own theme (just added above).

I was trying to use "CKEditor Custom CSS" in AOS config, but the file configured there was not loaded (Browser Network Analysis).

Share this post


Link to post
Share on other sites

Btw. how can I configure CodeMirror to not wrap lines?

I think code editors should not wrap lines.

I've changed:
 

config.codemirror = {
theme: 'theo',
lineWrapping: false
}

in "sample-cke.js" but it has no effect (The file is loaded, as it loads theme: 'theo')

Thank you.

Share this post


Link to post
Share on other sites

You were on the right path but that file is only a sample. Copy it elsewhere to templates/scripts for example and load it in assetpaths. 

19 minutes ago, theo said:

I was trying to use "CKEditor Custom CSS" in AOS config, but the file configured there was not loaded (Browser Network Analysis).

I don't know what is that, will do a search. 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

v1.8.5 is available, which contains @Robin S CKEditor Link Files CKE plugin, multilanguage-ready.

@theo Have you managed to solve the issue? I couldn't find any relevant info on "Browser Network Analysis". Are you sure you entered a correct path?

  • Like 3

Share this post


Link to post
Share on other sites
33 minutes ago, tpr said:

Have you managed to solve the issue? I couldn't find any relevant info on "Browser Network Analysis". Are you sure you entered a correct path?

Ah, sorry. I mean the tool that many browsers have, where you can see which files they are actually requesting and the HTTP status etc.

I could not find my CSS in this list and it had no effect, although the AOS file check was successful.

Example Screenshot:

networkanalysis.thumb.png.8f8f2b4fa990b7457024d858dd21bbe0.png

 

Thank you.

Share this post


Link to post
Share on other sites

Perhaps it could help if you pasted the path you entered here.

Share this post


Link to post
Share on other sites

Everything seems normal. But while it loads the cke.js it does not load the test.css afaics.

Thank you.

aoscss.png.183857c850a97ef2bda4f033f5c91560.png

Share this post


Link to post
Share on other sites

Interesting, I can only think of an adblocker or similar that prevents loading the file.

Share this post


Link to post
Share on other sites

Ah, now I see.

If there is a CKE CSS configured in the field page, then the one configured in AOS is not loaded.

Thank you.

  • Like 2

Share this post


Link to post
Share on other sites

Good catch! Just modified the module to allow loading both, thanks. 
(will be released later)

  • Like 2

Share this post


Link to post
Share on other sites

Hey @tpr - would you mind enabling field edit links for the user template please? I expect it's just a matter of adding ProcessUser instead of just ProcessPageEdit

Thank you!

  • Like 1

Share this post


Link to post
Share on other sites

You mean only for non-system fields, right? 

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, tpr said:

You mean only for non-system fields, right? 

I hadn't really thought about it, but if you think that's better, that's fine. The main thing is that I have a LOT of extra fields in my user template on one of the sites I am working on and I am missing that functionality.

  • Like 1

Share this post


Link to post
Share on other sites

@adrian I've modified field edit links to appear on every page, for non-system fields only, please check.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180817, v1.0.6, support for joining multiple finders 180810, v1.0.5, basic support for options fields 180528, v1.0.4, add custom select statement option 180516, change sql query method, bump version to 1.0.0 180515, multilang bugfix 180513, beta release <180513, preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By OLSA
      Hello for all,
      ConfigurationForm fieldtype module is one my experiment from 2016.
      Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end.
      Install and setup:
      Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it:
      In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets").
      Basic usage example:
      ConfigForm fieldtype "setup" has subfields:
      "limit", type select, option values: 5, 10, 15, 20
      "sort", type select, option values: "-date", "date",  "-sort", "sort"
      // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort");  
      Screenshots:


       
      Notes:
      Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module.
      Thanks:
      Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin.
      In field type "link" I use javascript part from @marcostoll module and thanks to him for that part.
      Download:
      FieldtypeConfigForm.zip
      Edit: 14. August 2018. please delete/uninstall previously downloaded zip
      Regards.
         
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://gitlab.com/baumrock/RockPdf
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. Thanks!
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/RockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour.
       
      Changelog
      180730 support subdir installations 180711 bugfix (naming issue) 180630 alpha realease  
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module: