Yep, what I will be doing over the holidays. There are a number of features I'm considering adding (snippets for nearly all the editors, not just wysiwyg, sorting, config in the configs folder). Are there any suggestions you would like to see?
I finally had an opportunity to install MySnippets on 7.1.0 RC today to assess what needs to be done. Looks like everything seems to be working except the most important piece: adding the actual icon to the toolbar on the editor.
I'm really close, it "almost" works as-is but doesn't meld well with TinyMCE which is where I'm at. I will get it, just been really busy as of late. Future looks good in the next week or so especially since I'm working on a U7 site now.
I've started it. All works currently except the actual selection modal. I'm rewriting it to utilize the Angular benefits of 7. The next version will not be backwards compatible with previous versions of Umbraco.
Is there any update about v7 compatible version of mysnippets. I really need this kind of functionality in one of my projects. Would be great if you can update about it.
Not sure how far you got on this, but I had a client who really wanted to keep this functionality after a v6 upgrade and I think I managed to get it all working. Let me know if you'd like to collab on getting a new release out!
for all of you who are waiting patiently on the v7 update. I've made some adjustments... So, install the package. Copy (or move, living on the edge) the folder in \umbraco_client\Tinymce3\Plugins\mysnippets to \umbraco\lib\tinymce\plugins\mysnippets
In tinymce.config you'll also want to change the url to the image if you moved the folder. I also put the mysnippets on priority 75.
Delete the editor...js files. Put a plugin.min.js in place and drop the following code in that file. (note: i deleted the preview folder. It had no use in our case) It will probably not be as good as the original but it's a good start for a v7 one. I kept the rest as original it does not look that good in the developer section & it has a few quirks but it works. Would be nice to have an open source repo :-)
tinymce.PluginManager.add('mysnippets', function(editor,url) {
function getNoCacheSnippetUrl() {
var d = new Date();
return "/config/mysnippets.xml?d=" + d.getTime(); // don't cache
}
function showDialog() {
var win, data = {}, dom = editor.dom;
var width, height;
var snippets = new Array();
var availableSnippets = new Array();
availableSnippets.push({text:'Choose snippet', value:''});
var generalFormItems = [];
$.ajax({
type: "GET",
url: getNoCacheSnippetUrl(),
dataType: "xml",
success: function(xml) {
$(xml).find("MySnippet").each(function()
{
var id = snippets.length; //$(this).find('id').text();
var nm = $(this).find('Name').text();
var cd = $(this).find('Snippet').text();
availableSnippets.push({text:nm, value:id});
snippets[id] = cd;
});
generalFormItems = [
{
type: 'listbox',
label: 'Snippet',
name: 'snippet',
minWidth: 200,
values: availableSnippets,
autofocus: true
}];
win = editor.windowManager.open({
title: 'Insert snippet',
body: generalFormItems,
onSubmit: onSubmitForm
});
}
});
function onSubmitForm() {
editor.insertContent(snippets[win.find('#snippet').value()]);
editor.nodeChanged();
};
}
editor.addButton('mcemysnippets', {
icon: 'custom icon-books',
tooltip: 'Insert snippet',
onclick: showDialog
});
});
Yeah, it would be nice if there was an open repo... oh wait, that's up to me. I've had some life and career events happen so I've been MIA. I'm in a pursuit to push Sitefinity out in favor of Umbraco so I look to pick this stuff back up now.
Umbraco 7 Compatibility
Hi Jon,
do you have any plans making MySnippets compatible with Umbraco 7?
Yep, what I will be doing over the holidays. There are a number of features I'm considering adding (snippets for nearly all the editors, not just wysiwyg, sorting, config in the configs folder). Are there any suggestions you would like to see?
No special wishes at the moment. But good to hear that it's going on.
/horst
I finally had an opportunity to install MySnippets on 7.1.0 RC today to assess what needs to be done. Looks like everything seems to be working except the most important piece: adding the actual icon to the toolbar on the editor.
Hi Jon. Have you had the time to fix this last important issue? And have you tested MySnippets on the newest versions of Umbraco? Good work! :-)
I'm really close, it "almost" works as-is but doesn't meld well with TinyMCE which is where I'm at. I will get it, just been really busy as of late. Future looks good in the next week or so especially since I'm working on a U7 site now.
Thanks Jon! Looking forward to a new version for u7 :-)
Hi Jon! How far are you with the solution for u7? I understand if you're almost melting in the summer heat :-)
Hi Jon,
I wonder if you ever finished the v7 compatible version, as we are in need of the exact functionality?
Thans in advance :-)
I've started it. All works currently except the actual selection modal. I'm rewriting it to utilize the Angular benefits of 7. The next version will not be backwards compatible with previous versions of Umbraco.
Hi Jon,
Is there any update about v7 compatible version of mysnippets. I really need this kind of functionality in one of my projects. Would be great if you can update about it.
Many thanks in Advance.
Sanjay
Hi Jon,
Any update about new release compatible witn v7 Umbraco.
Thanks
Sanjay
Hi Jon,
Not sure how far you got on this, but I had a client who really wanted to keep this functionality after a v6 upgrade and I think I managed to get it all working. Let me know if you'd like to collab on getting a new release out!
Thanks, Tom
I'd love to see what you came up with. The source is in open https://bitbucket.org/blitzjon/umbraco.mysnippets
Looks like that repo is private ;). If you want to open it up I can send a pull request with what I've done so far.
Hi all,
for all of you who are waiting patiently on the v7 update. I've made some adjustments... So, install the package. Copy (or move, living on the edge) the folder in \umbraco_client\Tinymce3\Plugins\mysnippets to \umbraco\lib\tinymce\plugins\mysnippets In tinymce.config you'll also want to change the url to the image if you moved the folder. I also put the mysnippets on priority 75.
Delete the editor...js files. Put a plugin.min.js in place and drop the following code in that file. (note: i deleted the preview folder. It had no use in our case) It will probably not be as good as the original but it's a good start for a v7 one. I kept the rest as original it does not look that good in the developer section & it has a few quirks but it works. Would be nice to have an open source repo :-)
Yeah, it would be nice if there was an open repo... oh wait, that's up to me. I've had some life and career events happen so I've been MIA. I'm in a pursuit to push Sitefinity out in favor of Umbraco so I look to pick this stuff back up now.
Hehe, that would be awesome, thanks! :-)
I was looking for this functionality too and found this...
http://www.wiliam.com.au/wiliam-blog/adding-enhanced-styling-to-the-umbraco-tinymce-editor
Works great. Some great posts on that blog.
is working on a reply...