Author Topic: Forum [p3d] embedding  (Read 1600 times)

Considering the amount of modelling work that gets done around here for add-ons and such, I believe it would be a good idea to implement the [p3d] tag to embed 3D models into the forums. P3D is a site that allows users to upload a 3D model and then view it in their web browser.

More information: http://p3d.in/faq/integration
Implementation: https://docs.google.com/document/d/1UxMXKYpEzum4qB-DC7ueBjZxvu74F8qlh8KZyJcydCg/edit

Icon I made:
« Last Edit: June 22, 2015, 08:42:02 PM by TristanLuigi »

Good idea but I bet it's not going to happen.




it's not going to happen on the forum itself, but it would be hypothetically doable with a userscript

it's not going to happen on the forum itself, but it would be hypothetically doable with a userscript
it looks very easy to implement, judging from the google doc, and nobody would use it from a userscript



it looks very easy to implement
many things would be, but badspot still isn't going to do it

many things would be, but badspot still isn't going to do it
I know he probably won't, but there is no good reason not to

I know he probably won't, but there is no good reason not to
Because SMF is terrible, and he has already made a lot of tweaks to the current version. I could very much see it being a hassle to get working for any number of reason, more of a hassle than could be justifiable for something small like this.
Also, just from a personal standpoint as a user, I do not like the strange trend of forums and the like lately to have everything embeddable when links would suffice just as well. It's cluttered looking and slows loading. I'm glad this forum is one of like 2 (and I guess 4chan) that I'm active on that draw the at just images.
« Last Edit: June 25, 2015, 10:56:29 PM by ·:Taboo:· »


https://greasyfork.org/en/scripts/10233-too-many-embeds

Alternate version with just p3d.in:
Code: [Select]
// ==UserScript==
// @name Blockland Embedder for p3d.in
// @namespace https://greasyfork.org/en/scripts/10233-too-many-embeds#p3d
// @author Steve5451 and dargereldren
// @version 1.0.0
// @description Embed links from p3d.in
// @icon https://p3d.in/model_data/snapshot/9GLHs
// @require http://code.jquery.com/jquery-2.1.1.min.js
// @include http://forum.blockland.us/*
// ==/UserScript==

$('a[href*="p3d.in/"]').each(function() {
var p3dId = $(this).attr('href').split('/');
p3dId = p3dId[p3dId.length - 1];
embedMedia(p3dId, $(this), 'p3dExpand');
console.log(p3dId);
});

function embedMedia(medId, thisItem, embedType) {
thisItem.after(' <input type="button" value="Embed" class="embedMedia" id="' + embedType + '" expanded="false" medId="' + medId + '" /> ');
}

$(document).find(".embedMedia").click(function() {
if ($(this).attr('expanded') == "false") {
var thisId = $(this).attr('id');
if (thisId == 'p3dExpand') {
$(this).after('<div><iframe src="https://p3d.in/e/' + $(this).attr('medId') + '+load" width="640" height="480" frameborder="0" seamless allowfullscreen webkitallowfullscreen></iframe></div>');
}

$(this).val("Remove")
$(this).attr('expanded', 'true');
} else {
$(this).next().remove();
$(this).val("Embed")
$(this).attr('expanded', 'false');
}
});

Known issues:

« Last Edit: June 27, 2015, 12:48:08 PM by dargereldren »

Why can't we just link it?