Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 24, 2018 8:58:22 GMT -8
Hi! I'd like to request a plugin to insert sheets in posts. I have tried Excel to Posts by Pebble, but it didn't work. I also tried the one from Wormopolis, and it worked, but it shows only the first tab. Neither of them has been updated in years, so I was afraid to never get a response if I asked for an upgrade. Both Google Sheets and Excel Online provide links for embed content and allow choosing specific tabs, so a plugin compatible with any of those would be perfect.
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 25, 2018 9:20:37 GMT -8
bump Is my request clear? My English may be confusing sometimes.
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 26, 2018 9:36:30 GMT -8
bump
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jan 27, 2018 9:18:26 GMT -8
Pebble is still an active member, so tagging him may get a response. Wormopolis unfortunately is currently MIA, but he does resurface every now and again, so keep your fingers crossed... He may just see this.
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 27, 2018 15:17:47 GMT -8
Pebble is still an active member, so tagging him may get a response. Wormopolis unfortunately is currently MIA, but he does resurface every now and again, so keep your fingers crossed... He may just see this. Thank you for tagging them, Todge! I hope they'll help me out with this
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 28, 2018 17:10:50 GMT -8
bump
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 29, 2018 17:19:22 GMT -8
bump
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jan 30, 2018 10:08:30 GMT -8
For someone who uses neither of the resources mentioned in the first post it might help if you went into detail about the tab selection process you mentioned (preferably with how-to links from the respective resources). It would greatly increase the chances of a new plugin being created if you decreased the workload by providing information you already have on hand. A link to an actual document for testing purposes may be of great use as well.
Keep in mind that these plugins are done on a voluntary basis by people who most likely have to work for a living and try to do these things with the leftover free time they may get from time to time after taking care of their own real life concerns.
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Jan 31, 2018 6:10:16 GMT -8
For someone who uses neither of the resources mentioned in the first post it might help if you went into detail about the tab selection process you mentioned (preferably with how-to links from the respective resources). It would greatly increase the chances of a new plugin being created if you decreased the workload by providing information you already have on hand. A link to an actual document for testing purposes may be of great use as well. Well, now that I think about it, that was dumb of me for not explaining how it happens. Here is a tutorial for Excel Online.Here is a tutorial for GSheets.Excel Online and Google Sheets provide links for sharing sheets, and you are given the option to embed content, which has an additional option for choosing which tabs (GSheets) / cells (Excel Online) you want to show. Excel goes further on customization and allows you to choose the size of the frame, visibility of gridlines and headers, if it's editable, etc. This is an example of a Google Sheets link generated for the whole document: <iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQk6EWBOt3sDJO_sixcISzUtZRLC91rRcG0iM_Ok1cskElELdLkJgsIbk0M3C-mdueNY796FtJMtMNt/pubhtml?widget=true&headers=false"></iframe> And this is a link for a single tab/page: <iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQk6EWBOt3sDJO_sixcISzUtZRLC91rRcG0iM_Ok1cskElELdLkJgsIbk0M3C-mdueNY796FtJMtMNt/pubhtml?gid=0&single=true&widget=true&headers=false"></iframe> It adds "gid= #&single=true&" after "pubhtml?", # being the number of the page you want (counting starts from zero). And here is how it looks when applied to a page: GSheets example. Wormopolis'plugin won't work because it uses the sheet ID only. So it's only possible to show the whole document. As for Excel Online, this is the link it provides for the whole document: <iframe width="402" height="346" frameborder="0" scrolling="no" src="https://onedrive.live.com/embed?resid=62D42F5FA1085237%21117&authkey=%21AA-Sof8lQFyiPFw&em=2&wdAllowInteractivity=False&wdInConfigurator=True"></iframe> Here is the link for specific cells (Sheet1, cells B2 to D24): <iframe width="308" height="446" frameborder="0" scrolling="no" src="https://onedrive.live.com/embed?resid=62D42F5FA1085237%21117&authkey=%21AA-Sof8lQFyiPFw&em=2&wdAllowInteractivity=False&Item='Sheet1'!B2%3AD24&wdInConfigurator=True"></iframe> It adds "&Item='Sheet1'!B2%3AD24". And here is how it looks when applied to a page: Excel Online example. I'm sorry it got long, but I wasn't sure which info could be useful. >< If any part wasn't clear, please feel free to ask. I am well aware that no one has the obligation of making such plugin. As I was searching for a solution in the Support, I noticed that two other people had asked about the exact same thing, so it's not a (totally) selfish request. I'm just hoping that some coder has some spare time to take a look into this. ^^
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Feb 2, 2018 4:21:22 GMT -8
bump
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Feb 3, 2018 5:08:17 GMT -8
bump
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Feb 5, 2018 15:08:33 GMT -8
bump ;u;
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Feb 9, 2018 21:36:34 GMT -8
Since no one has taken on this request and I find myself with a bit of free time today I wrote a tiny plugin that should hopefully meet the desired functionality. ( download) The plugin is written to be configurable as to which type, host, document, etc are considered embeddable on the forum and comes preconfigured with an entry for docs.google.com and onedrive.live.com as detailed in the request. Usage:To create an embed simply create a link to the resource and add a name="embed" property to that link. If the resource referenced by that link is in your allowed list and all the other optional criteria (path and query) matches then an embed is created to replace that link. You could also enable the "automatically embed" option on the preferences tab which would then embed any link that matches any hosts you've added to the allowed list (and any additional criteria in path or query) regardless of whether it had the name="embed" property. Coding:The created iframes are given classes matching the domain where their resources are hosted, an iframe from docs.google.com for example would be given a class of docs_google_com. Any additional criteria specified for that domain would also add additional class names so if the entry for docs.google.com specified that the link also needed to have " spreadsheets" and " pubhtml" in the path before it would be converted to an iframe then the classes of path-spreadsheets and path-pubhtml would also be added to the iframe after conversion for styling different resources from the same domain. The plugin provides an ad hoc CSS default size for the two requested domains that come preconfigured via the classes as specified above but the author of the post has the ability to override that styling by providing the posted link with an inline style [a href="https://docs.google.com/spreadsheets/d/e/2PACX-1vQk6EWBOt3sDJO_sixcISzUtZRLC91rRcG0iM_Ok1cskElELdLkJgsIbk0M3C-mdueNY796FtJMtMNt/pubhtml?widget=true&headers=false" name="embed" style="width:450px;height:450px;"]gdoc spreadsheet[/a]
Javascript
/* Proboards Plugin: Document Embedder Version: 0.0.8 Last Update: 7:22 PM Sunday, September 08, 2019 Description: Create embeddable documents within posts */ (function (myplugin) { function anchorManagement(){ /* execute only on pages that contain posts */ /* OR POST WIDGETS (6/2/2019)*/ var pb_post_data = $.extend({},pb.data('proboards.post')); for( let wid in pb.data('widget')){ if(pb.data('widget')[wid].type.indexOf('post') !== -1){ pb_post_data[wid]=$.extend({},pb.data('widget')[wid],{wid:'#',combi:' .widget-content a'}); } }; $.each(pb_post_data, function (pid, pdata) { var docs = $( (pdata.wid||'#post-') + pid + (pdata.combi||' .message a') + (myplugin.settings.options.indexOf('autoembed') === -1 ? '[name="embed"]':'') ).each( function (i, e) { var url;
/* convert to an non-redirect url so we can check for parts */ if(e.host.indexOf("vig"+"link.com") !== -1 ){ url = new URL("http" + decodeURIComponent(e.search.split("http")[1])) }else{ url = e; } /* should not embed own forum so test for known domains as well as guard against custom domain NOTE: AFAIK there is no way to reliably test for custom domain other than by comparing against current domain so still possible to embed via custom down when posting from original domain or linking to another forum with a custom domain */ if(/\.(proboards\.com|(boards|freeforums)\.net)/i.test(url.hostname) || url.hostname == location.hostname){ /* "log" function was removed causing reference error so changed to console.warn (9/8/2019) */ return (console.warn('Cannot embed a proboards forum ("'+url.href+'")'), !0); } /* cycle through allowed domains in plugin settings to see if this domain and qualifiers (path, query) has been allowed */ $.each(myplugin.settings.allowedDomains, function (i, domain) { var url_hostname = url.hostname.toLowerCase().trim(), domain_hostname = domain.hostname.toLowerCase().trim(); if (domain_hostname === url_hostname || (/^\./.test(domain_hostname) && url_hostname.substr(-domain_hostname.length) === domain.hostname)) { /* if one or more paths were specified but does not match what is in the url then abort */ if(domain.path){ if(domain.path.split(" ").reduce( function(a,c){ return a+(url.pathname.indexOf(c) === -1 ? "" : " "+c ) } ) !== domain.path) return true; } /* if one or more queries were specified but does not match what is in the url then abort */ if(domain.query){ if(domain.query.split("&").reduce( function(a,c){ return a+(url.search.indexOf(c) === -1 ? "" : "&"+c ) } ) !== domain.query) return true; } /* create iframe and apply any sandbox permissions specified for this domain */ var $iframe = $('<iframe />', { "allowfullscreen" : true, "sandbox": (domain.sandbox?domain.sandbox.join(" ").trim():""), "style":domain.css }).on('error', function(ev){ $iframe.attr('srcdoc', '<html><head></head><body>'+ev.message+'</body></html>') }).on('load', function(ev){ $iframe.addClass(domain.hostname.replace(/\W/g,"_") + (domain.path?" path-"+domain.path.replace(/[^a-zA-Z0-9 ]/g,"").split(" ").join(" path-"):"") + (domain.query?" query-"+domain.query.replace(/\=/g,"_eq_").replace(/[^a-zA-Z0-9&_]/g,"").split("&").join(" query-"):"")) }) /* set the url on the iframe and attempt to load the contents */ $iframe.attr({src: url.href}) /* if anchor has width and height specified then transfer them over */ /*UPDATE: APPLY THE FULL STYLE TO ALLOW FOR GREATER STYLING OPPORTUNITIES */ $iframe.attr('style', $(e).attr('style')) /* and replace the tag */ $(e).after($iframe).hide(); /* no need to keep looking so break this each loop */ return false; } })
}) }) } $(anchorManagement) pb.events.on('afterSearch', anchorManagement) })(pb.plugin.get("document_seeker")) /* VERSION LOG: 0.0.1 (Feb 9, 2018 9:33PM) - initial alpha release 0.0.2 (Feb 9, 2018 11:00PM) - added additional iframe classes for targeted styling and transferred styling on anchor to the iframe so the post author could have control over size of iframe 0.0.3 (Feb 13, 2018 7:30AM) - fixed "nothing selected is null" bug in allowed domains permissions field introduced with UI switching to multi-select selection box from multi-select checkbox 0.0.4 (Feb 14, 2018 7:05PM) - added warning about embedding own forum within a post 0.0.5 (Jun 2, 2019 1:43AM) - added support for subdomains 0.0.6 (Jun 3, 2019 12:15PM) - added support for post widgets 0.0.7 (July 22, 2019 4:30PM) - refactored code and added newer "allow-top-navigation-by-user-activation" sandbox option 0.0.8 (Sept 8, 2019 7:00PM) - fixed dereferenced "log" function which was apparently removed during refactoring
*/
CSS
/* default dimensions for google docs iframe */ .docs_google_com { width: 500px; height: 400px; }
/* default dimensions for onedrive docs */ .onedrive_live_com { width: 600px; height: 500px; }
|
|
Amy
New Member
Anything unrelated to elephants is irrelephant.
Posts: 33
inherit
251934
0
Apr 23, 2018 5:31:13 GMT -8
Amy
Anything unrelated to elephants is irrelephant.
33
January 2018
amyalsandair
|
Post by Amy on Feb 11, 2018 5:26:45 GMT -8
Since no one has taken on this request and I find myself with a bit of free time today I wrote a tiny plugin that should hopefully meet the desired functionality. ( download) !!! I have no words to describe how awesome you are, Chris!! But if there was a treasure of awesomeness, you'd be inside the chest! Thank you so much!!! My team is also grateful. It'll save us a bunch of time when updating info. Just tried in my forum and both GSheets and Excel sheets worked fine. ^^ Thanks again!
|
|