Sha256: 804e7f0bce0faf65a4aa2e59664a4c314d87df3500d34ba7ff8a8bf7d2318754
Contents?: true
Size: 982 Bytes
Versions: 16
Compression:
Stored size: 982 Bytes
Contents
<% template = File.join(SocialNetworking::Engine.root, 'app/views/social_networking/shared/_sharing_fields.html') %> <% js_helper = Class.new.extend(ActionView::Helpers::JavaScriptHelper) %> ;(function() { function addSharingToNewShareableForm() { 'use strict'; var actionType, displayName, itemType, placeholder, template; placeholder = $('.new-shareable-form-after-form-groups'); actionType = placeholder.data('actionType'); itemType = placeholder.data('itemType'); template = '<%= js_helper.j(Erubis::Eruby.new(File.read(template)).result) %>'; displayName = itemType; if (displayName) { displayName = displayName.replace('_', ' '); } template = template.replace(/{{ ITEM_TYPE }}/g, itemType).replace(/{{ ITEM_TYPE_DISPLAY }}/g, displayName).replace(/{{ ACTION_TYPE }}/g, actionType); placeholder.append(template); }; $(document).on('page:change', addSharingToNewShareableForm); })();
Version data entries
16 entries across 16 versions & 1 rubygems