gravatarIcon
This question has been answered by donshakespeare. See the first response.
$( document ).ready(function() { ... // replace crappy anonymous gravatars var oldGravURL = "http://www.gravatar.com/avatar/bce74cfa75d744dd993a3150dc277268?s=80&d=mm"; //from step 1 above. Your's will probably end in "d=identicon" as that is the default var newGravURL = "http://content.cmhworks.com/img/anonymous.png"; //from step 2 above. Attached below if you want to use at 80px x 80px. var anonGravs = $('img[src$="' + oldGravURL + '"]'); //grabs all anonymous gravatars matching the oldGravURL // loop through each and replace src $.each(anonGravs, function(){ //console.log($(this).attr('src')); //uncomment to see the old url in the console $(this).attr('src', newGravURL); }); ... });
After looking at the option on the gavatar site (http://en.gravatar.com/site/implement/images/), I realized that the options are quite limited but do explain the potential values for the gravatarIcon setting.
http%3A%2F%2Fcontent.cmhworks.com%2Fimg%2Fanonymous.png
<li class="[[+cls]]" id="[[+idprefix]][[+id]]" [[+depth_margin:notempty=`style="padding-left: [[+depth_margin]]px"`]]> <div id="[[+idprefix]][[+id]]-div" class="quip-comment-body [[+alt]]"> <div class="quip-comment-right"> [[+gravatarUrl:notempty=`<img src="[[+gravatarUrl]]" class="quip-avatar" alt="" />`]] </div>...
<li class="[[+cls]]" id="[[+idprefix]][[+id]]" [[+depth_margin:notempty=`style="padding-left: [[+depth_margin]]px"`]]> <div id="[[+idprefix]][[+id]]-div" class="quip-comment-body [[+alt]]"> <div class="quip-comment-right"> [[!myGravatar? &size=`100` &quipEmail=`[[+email]]` &default=`http%3A%2F%2Fcontent.cmhworks.com%2Fimg%2Fanonymous.png`]] </div>...
<?php $modxEmail = $quipEmail; $modxEmail = md5(strtolower(trim($modxEmail))); $modxGrav = "http://www.gravatar.com/avatar/" . $modxEmail . "?s=" . $size . "&d=" . $default; $modxGravatar = '<img class="myGravatar" src="' . $modxGrav . '" alt="Gravatar.com Image" /></a>'; return $modxGravatar;
GravatarIcon for anonymous users?You mean anonymous, as in, non-members, or as in people without Gravatar-enabled emails?
<script type="text/javascript"> tinymce.init({ selector: "textarea", plugins: "textpattern", textpattern_patterns: [ {start: '*', end: '*', format: 'italic'}, {start: '**', end: '**', format: 'bold'}, {start: '#', format: 'h1'}, {start: '##', format: 'h2'}, {start: '###', format: 'h3'}, {start: '####', format: 'h4'}, {start: '#####', format: 'h5'}, {start: '######', format: 'h6'}, {start: '1. ', cmd: 'InsertOrderedList'}, {start: '* ', cmd: 'InsertUnorderedList'}, {start: '- ', cmd: 'InsertUnorderedList'} ] }); </script> <form method="post" action="dump.php"> <textarea name="content">Press enter after using a Markdown code</textarea> </form>
I don't know your current progress at this time...
But, you don't need that jQuery or Quip's gravatar, create your own awesome snippet.
If you'd prefer to use your own default image (perhaps your logo, a funny face, whatever), then you can easily do so by supplying the URL to an image in the d= or default= parameter. The URL should be URL-encoded to ensure that it carries across correctly, for example:
<img src="http://www.gravatar.com/avatar/00000000000000000000000000000000?d=http%3A%2F%2Fexample.com%2Fimages%2Favatar.jpg" />
As for markdown for Quip comments.
Idea is to provide a Markdown experience for the user, but convert to HTML onSubmit, since Markdown code, as far as I know is useless to Quip's(allowed tags).
You can specify which Markdown code is allowed, of course you shall have set the HTML equivalent in your Quip config.
Use JS to find and replace, just before submitting.
Or present one Markdown textarea, different from the Quip's which you can hide or use as preview.
As the user types in the 2nd textarea, it transforms on the fly, onkeyup, to pure html source on Quip's textarea
E.g https://markdown-it.github.io/
https://markdown-it.github.io/
Or, use the awesome TinyMCE 4.2's text which does all this for you. Load TinyMCE CDN on demand, so as not to slow your site an inch.
And since you are now using only one form for Quip, you are in great luck.
Paste this code in the fiddle to fiddle with it
http://fiddle.tinymce.com/
<script type="text/javascript"> tinymce.init({ selector: "textarea", plugins: "textpattern", textpattern_patterns: [ {start: '*', end: '*', format: 'italic'}, {start: '**', end: '**', format: 'bold'}, {start: '#', format: 'h1'}, {start: '##', format: 'h2'}, {start: '###', format: 'h3'}, {start: '####', format: 'h4'}, {start: '#####', format: 'h5'}, {start: '######', format: 'h6'}, {start: '1. ', cmd: 'InsertOrderedList'}, {start: '* ', cmd: 'InsertUnorderedList'}, {start: '- ', cmd: 'InsertUnorderedList'} ] }); </script> <form method="post" action="dump.php"> <textarea name="content">Press enter after using a Markdown code</textarea> </form>
And of course you can force TinyMCE 4.2 to never add or subtract from your allowed pre-specified HTML tags.
Use parameters valid_elements etc