inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 19, 2014 7:38:56 GMT -8
this is a plugin that allows a user to define their own style classes. (would be nice if I could get it to work for that post only) here's an example using a DIV: tcll5850.proboards.com/thread/248/post-cssthe div doesn't contain the class attribute in posts (which I'm honestly surprized about)... :/ so I'm currently working on redoing every BBC element that can support class="" it works in my real-time previewer (which still isn't finished for those who want it).
|
|
Former Member
inherit
guest@proboards.com
131621
0
Dec 2, 2024 5:57:16 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 19, 2014 9:55:14 GMT -8
What is the difference between this abs ipokemon's style plugin?
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 19, 2014 10:22:26 GMT -8
didn't know he had one >_> mine has an extension to work with my previewer though... heh (that's probably the only difference) also, to add, I've merged all of my BBC plugins into 2 plugins (needed some room to make other plugins) so when I release, I'll be releasing packs where you can enable or disable the BBC features. (this actually helps with efficiency of all of my BBC plugins) ^ my previewer is a bit faster now EDIT: also... not sure why this isn't working: function Tcll5850_BBCPP1_code_handler(post) { return post.replace(/\<code(.+?)>(.+?)<\/code>/g, function(BBC,tag,code) { return '<code'+tag+'>'+code.replace(/\[/g, "[").replace(/\]/g, "]")+'</code>'; }); };
it's supposed to replace the BBC characters in code-blocks, but the characters still parse anyways... >_> EDIT2: quote this message for the actual code... the replacement characters are NOT '[' and ']'.
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 20, 2014 20:46:34 GMT -8
a small issue due to using my real-time previewer with this... every character pressed will generate a new style element in the head... how can I fix this to update the style element(s)?? the code: function(BBC,code) { code = code.replace(/\<br\>/g,'\n'); var style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = code; } // IE else { style.innerHTML = code; }; // Other browsers document.getElementsByTagName("head")[0].appendChild( style ); return '' } ^the problem: "appendChild( style )" what could I do to fix this?? thanks
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 22, 2014 5:11:39 GMT -8
well thanks for no response, I just love this kind of help. :af:
I finally figured it out, here's the console output from Opera:
Linked script not loaded Linked script not loaded Linked script not loaded Linked script not loaded Linked script not loaded Linked script not loaded Linked script not loaded created style#Tcll5850-PS-style-post-1019-msg created style#Tcll5850-PS-style-post-1020-msg created style#Tcll5850-PS-style-undefined-msg created style#Tcll5850-PS-style-admin-sig modified style#Tcll5850-PS-style-admin-sig Linked script not loaded Linked script not loaded Linked script not loaded 1 _global.newCID:true (Opera because IceDragon doesn't have a very friendly console)
here's the code that fixed it:
function Tcll5850_BBCPP1_style(post) { var type = window.Tcll5850_PS_Node[0]; var node = window.Tcll5850_PS_Node[1]; if (type==null) {var id = 'Tcll5850-PS-style-preview';} else if (type=='msg') { var id = 'Tcll5850-PS-style-'+$(node.parents()[6]).attr('id')+'-msg'; } else if (type=='sig') { var id = 'Tcll5850-PS-style-'+ (node.parent().parent().prev().find('.user-link').attr('title')+'-sig').replace('@',''); } else if (type=='usr') { var id = 'Tcll5850-PS-style-'+$(node.parents()[6]).find('.note.pad-right').text()+'-sig'; }; if ($('style#'+id).length > 0) { window.Tcll5850_PS_style = $('style#'+id); console.log('modified style#'+id); } else { window.Tcll5850_PS_style = document.createElement('style'); window.Tcll5850_PS_style.type = 'text/css'; window.Tcll5850_PS_style.id = id; document.getElementsByTagName("head")[0].appendChild( window.Tcll5850_PS_style ); console.log('created style#'+id); }; post = Tcll5850_BBCPP1_code_handler(post).replace( /\[class=(.+?)\]/g, '<span class=$1>').replace( /\[\/class\]/g, '</span>').replace( /\[style\](.+?)\[\/style\]/g, function(BBC,code) { code = code.replace(/\<br\>/g,'\n'); $(window.Tcll5850_PS_style).text(code); return '' }); window.Tcll5850_PS_Node = [null,null]; //reset return post; };
|
|
Former Member
inherit
guest@proboards.com
131621
0
Dec 2, 2024 5:57:16 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jun 22, 2014 6:15:11 GMT -8
Maybe try putting this in plugin development instead of the general plugins board? I'm sorry, I know nothing about plugins so I cannot help you =3
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 22, 2014 12:11:15 GMT -8
Maybe try putting this in plugin development instead of the general plugins board? I'm sorry, I know nothing about plugins so I cannot help you =3 lol yea, I was kinda more making a joke about this kind of stuff happening to me on everything I'm doing. (experts on the topic just don't reply when asked) the feature in this plugin is basically fully working it even merges multiple styles defined in the same post. (yes post styles is just a small feature) ^I've merged most of my BBC plugins as I needed more plugin space
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 23, 2014 1:35:33 GMT -8
well thanks for no response, I just love this kind of help. :af: lol yea, I was kinda more making a joke about this kind of stuff happening to me on everything I'm doing. (experts on the topic just don't reply when asked)
I don't care if you are joking or not, but that right there is not needed, and has given me sour impression of you. Did you even think that the day you posted (Friday), that the weekend was upon you, and that some of those "experts" (please list them, as I can only count a few who could probably help you that may have responded) have a life at the weekend? ₪» ⅀ ƪ Ƒ «₪ is also correct, the dev board would have been better, and may have got it noticed and maybe got a reply.
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Jun 23, 2014 8:35:09 GMT -8
calm down man, my bark is worse than my bite there... sorry I offended, I mean no harm. OT: lol your random ava fits the mood of your post: XD as far as time, I give them months with no response. and yeh, next time I will. EDIT: if you want, I can edit that out and we can forget I ever said that.
|
|