Suggestion: Link tag specifically for VDC

Comments & Suggestions about Interlopers.net

Suggestion: Link tag specifically for VDC

Postby krainert on Mon Mar 22, 2010 11:41 am

Mjallo again,

Suggestion: A link tag equivalent to {url=url}text{/url} but specifically for Valve Developer Community.

Functionality:
  • {vdc}ref{/vdc} => <a title="ref" href="http://developer.valvesoftware.com/wiki/ref">ref</a>
  • {vdc=ref}text{/vdc} => <a title="ref" href="http://developer.valvesoftware.com/wiki/ref">text</a>
([ and ] replaced with { and }, respectively.)

This might greatly inspire members to use links whenever referring to Source entities which would cut down on time finding the appropriate documentation the old way.

Further suggestion: Automatic recognizance of entity references.

Example:
  • I really like env_text. => I really like <a title="env_text" href="http://developer.valvesoftware.com/wiki/env_text">env_text</a>.
User avatar
krainert
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Dec 20, 2007 2:57 pm
Location: Denmark

Re: Suggestion: Link tag specifically for VDC

Postby Terr on Mon Mar 22, 2010 10:27 pm

Seconded. I wanted this in TF2maps as well. However, automatically recognizing entity references might be a bit harder, so really just the VDC linking would be nice.
Terr
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Oct 12, 2009 11:35 pm

Re: Suggestion: Link tag specifically for VDC

Postby krainert on Mon Mar 22, 2010 10:40 pm

Thanks for the support.
Frankly, the difference is marginal. I'd say the choice it's more a matter of unintended matches - but given the nature of entity names I don't consider the event of them randomly being recognized as part of an irrelevant string realistic; how often does one write func_brush without referring to the entity? Generally, how often does one use underscores outside technical definitions?

EDIT:
Here's a piece of code:
Code: Select all
<?php
$triggers = array(
   "func_detail",
   "func_brush",
   "env_text"
);
function addVDCLinks($string) { // Takes output string, returns string with added links
   foreach ($triggers as &$t)
      $string = str_replace($t, "<a title=\"$t\" href=\"http://developer.valvesoftware.com/wiki/$t\">$t</a>", $string);
   unset($t);
   return $string;
}
?>
User avatar
krainert
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Dec 20, 2007 2:57 pm
Location: Denmark

Re: Suggestion: Link tag specifically for VDC

Postby Terr on Tue Mar 23, 2010 2:32 am

My main concern with auto-links is preventing them from messing up code snippets.
Terr
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Oct 12, 2009 11:35 pm

Re: Suggestion: Link tag specifically for VDC

Postby krainert on Tue Mar 23, 2010 8:36 am

Oh, right. Well... A little regex might fix it so anything in {code}{/code} is ignored.
User avatar
krainert
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Dec 20, 2007 2:57 pm
Location: Denmark

Re: Suggestion: Link tag specifically for VDC

Postby zombie@computer on Tue Mar 23, 2010 1:04 pm

phpbb is already slow as concrete shit, you want to mess with regexes as well? sheesh :)

phpbb preparses messages as you post them (marking valid tags with a bbcode_uid), easy to use

the problem lies in this bit:

Code: Select all
<?php
$triggers = array(
   "func_detail",
   "func_brush",
   "env_text"
);

theres thousands of triggers, and its a bitch to go through.
Edit: there's 433 hl2 entities, lol

Javascript would be a more ideal source though.
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Suggestion: Link tag specifically for VDC

Postby Blink on Tue Mar 23, 2010 2:17 pm

The VDC link tag idea is a good one.

I'll look into the client side version of checking the posts for certain names. I imagine it would be faster than getting the server to do it all.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Re: Suggestion: Link tag specifically for VDC

Postby zombie@computer on Tue Mar 23, 2010 2:47 pm

wait a sec, ill whip it up :)
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Suggestion: Link tag specifically for VDC

Postby zombie@computer on Tue Mar 23, 2010 3:15 pm

Code: Select all
function replacewords ()
{
   var divs = document.getElementsByTagName("div");
   var entities=["ai_ally_manager","ai_battle_line","ai_changehintgroup","ai_changetarget","ai_citizen_response_system","ai_goal_actbusy","ai_goal_actbusy queue","ai_goal_assault","ai_goal_follow","ai_goal_lead","ai_goal_lead weapon","ai_goal_police","ai_goal_standoff","ai_relationship","ai_script_conditions","ai_sound","ai_speechfilter","aiscripted_schedule","assault_assaultpoint","assault_rallypoint","info_apc_missile_hint","info_node","info_node_air","info_node_air hint","info_node_climb","info_node_hint","info_node_link","info_node_link_controller","info_npc spawn_destination","info_snipertarget","logic_choreographed_scene","path_corner","path_corner_crash","path_track","scripted_scene","scripted_sentence","scripted_sequence","scripted_target","tanktrain_aitarget","tanktrain_ai","env_ar2explosion","env_beam","env_beverage","env_blood","env_bubbles","env_citadel_energy_core","env_credits","env_cubemap","env_dustpuff","env_effectscript","env_embers","env_entity_dissolver","env_entity_igniter","env_entity_maker","env_explosion","env_extinguisherjet","env_fade","env_fire","env_firesensor","env_firesource","env_flare","env_fog_controller","env_funnel","env_global","env_gunfire","env_headcrabcanister","env_hudhint","env_laser","env_lightglow","env_message","env_microphone","env_muzzleflash","env_particlelight","env_particlescript","env_physexplosion","env_physimpact","env_player_surface_trigger","env_rotorshooter","env_rotorwash","env_screenoverlay","env_shake","env_shooter","env_smokestack","env_smoketrail","env_soundscape","env_soundscape_proxy","env_soundscape_triggerable","env_spark","env_speaker","env_splash","env_sprite","env_spritetrail","env_starfield","env_steam","env_sun","env_terrainmorph","env_texturetoggle","env_tonemap_controller","env_wind","env_zoom","filter_activator_class","filter_activator_name","filter_activator_team","filter_damage_type","filter_multi","func_areaportal","func_areaportalwindow","func_breakable","func_breakable_surf","func_brush","func_button","func_capturezone","func_changeclass","func_clip_vphysics","func_combine_ball_spawner","func_conveyor","func_detail","func_door","func_door_rotating","func_dustcloud","func_dustmotes","func_extinguishercharger","func_guntarget","func_healthcharger","func_illusionary","func_ladder","func_ladderendpoint","func_lod","func_lookdoor","func_monitor","func_movelinear","func_nobuild","func_nogrenades","func_occluder","func_physbox","func_physbox_multiplayer","func_platrot","func_precipitation","func_proprespawnzone","func_recharge","func_reflective_glass","func_regenerate","func_respawnroom","func_respawnroomvisualizer","func_rot_button","func_rotating","func_smokevolume","func_tank","func_tankairboatgun","func_tankapcrocket","func_tanklaser","func_tankmortar","func_tankphyscannister","func_tankpulselaser","func_tankrocket","func_tanktrain","func_trackautochange","func_trackchange","func_tracktrain","func_traincontrols","func_useableladder","func_vehicleclip","func_viscluster","func_wall","func_wall_toggle","func_water_analog","worldspawn","game_end","game_player_equip","game_player_team","game_ragdoll_manager","game_score","game_text","game_ui","game_weapon_manager","game_zone_player","info_camera_link","info_constraint_anchor","info_hint","info_intermission","info_ladder_dismount","info_landmark","info_lighting","info_mass center","info_no_dynamic_shadow","info_node","info_node_air","info_node_air hint","info_node_climb","info_node_hint","info_node_link","info_node_link_controller","info_npc_spawn_destination","info_null","info_overlay","info_particle_system","info_player_combine","info_player_deathmatch","info_player_logo","info_player_rebel","info_player_start","info_projecteddecal","info_snipertarget","info_target","info_target_gunshipcrash","info_teleporter_countdown","info_teleport_destination","infodecal","item_ammo_357","item_ammo_357_large","item_ammo_ar2","item_ammo_ar2_altfire","item_ammo_ar2_large","item_ammo_crate","item_ammo_crossbow","item_ammo_pistol","item_ammo_pistol_large","item_ammo_smg1","item_ammo_smg1_grenade","item_ammo_smg1_large","item_battery","item_box_buckshot","item_dynamic resupply","item_healthcharger","item_healthkit","item_healthvial","item_item_crate","item_rpg_round","item_suit","item_suitcharger","light","light_dynamic","light_environment","light_spot","logic_auto","logic_autosave","logic_branch","logic_case","logic_collision_pair","logic_compare","logic_lineto","logic_measure_movement","logic_multicompare","logic_navigation","logic_relay","logic_timer","ambient_generic","cycler","gibshooter","keyframe_rope","keyframe_track","material_modify_control","math_colorblend","math_counter","math_remap","momentary_rot_button","move_keyframed","move_rope","move_track","script_intro","script_tauremoval","shadow_control","sky_camera","test_sidelist","test_traceline","vgui_screen","water_lod_control","combine_mine","npc_alyx","npc_antlion","npc_antlion_template_maker","npc_antlionguard","npc_barnacle","npc_barney","npc_breen","npc_citizen","npc_combine_camera","npc_combine_s","npc_combinedropship","npc_combinegunship","npc_crabsynth","npc_cranedriver","npc_crow","npc_cscanner","npc_dog","npc_eli","npc_fastzombie","npc_fisherman (not available in Hammer by default)","npc_gman","npc_headcrab","npc_headcrab_black","npc_headcrab_fast","npc_helicopter","npc_ichthyosaur","npc_kleiner","npc_manhack","npc_metropolice","npc_monk","npc_mortarsynth","npc_mossman","npc_pigeon","npc_poisonzombie","npc_rollermine","npc_seagull","npc_sniper","npc_stalker","npc_strider","npc_turret_ceiling","npc_turret_floor","npc_turret_ground","npc_vortigaunt","npc_zombie","npc_zombie_torso","cycler_actor","generic_actor","info_npc_spawn_destination","monster_generic","npc_apcdriver","npc_bullseye","npc_enemyfinder","npc_furniture","npc_heli_avoidbox","npc_heli_avoidsphere","npc_heli_nobomb","npc_launcher","npc_maker","npc_missiledefense","npc_particlestorm","npc_spotlight","npc_template_maker","npc_vehicledriver","phys_ballsocket","phys_constraint","phys_constraintsystem","phys_convert","phys_hinge","phys_keepupright","phys_lengthconstraint","phys_magnet","phys_motor","phys_pulleyconstraint","phys_ragdollconstraint","phys_ragdollmagnet","phys_slideconstraint","phys_spring","phys_thruster","phys_torque","physics_cannister","player_loadsaved","player_speedmod","player_weaponstrip","point_anglesensor","point_angularvelocitysensor","point_antlion_repellant","point_apc_controller","point_bugbait","point_camera","point_clientcommand","point_commentary_node","point_devshot_camera","point_enable_motion_fixup","point_hurt","point_message","point_playermoveconstraint","point_servercommand","point_spotlight","point_teleport","point_template","point_tesla","point_viewcontrol","vehicle_viewcontroller","prop_combine_ball","prop_detail","prop_door_rotating","prop_dynamic","prop_dynamic_ornament","prop_dynamic_override","prop_physics","prop_physics_multiplayer","prop_physics_override","prop_ragdoll","prop_static","prop_thumper","prop_vehicle","prop_vehicle_airboat","prop_vehicle_apc","prop_vehicle_cannon","prop_vehicle_crane","prop_vehicle_driveable","prop_vehicle_jeep","prop_vehicle_prisoner_pod","trigger_autosave","trigger_changelevel","trigger_finale","trigger_gravity","trigger_hurt","trigger_impact","trigger_look","trigger_multiple","trigger_once","trigger_physics_trap","trigger_playermovement","trigger_proximity","trigger_push","trigger_remove","trigger_rpgfire","trigger_soundscape","trigger_teleport","trigger_transition","trigger_vphysics_motion","trigger_waterydeath","trigger_weapon_dissolve","trigger_weapon_strip","trigger_wind","weapon_357","weapon_alyxgun","weapon_annabelle","weapon_ar2","weapon_brickbat","weapon_bugbait","weapon_citizenpackage","weapon_citizensuitcase","weapon_crossbow","weapon_crowbar","weapon_extinguisher","weapon_frag","weapon_physcannon","weapon_physgun","weapon_pistol","weapon_rpg","weapon_shotgun","weapon_smg1","weapon_stunstick"];
   var textNodes=[];
   for(var d in divs)
   {
      var theDiv = divs[d];
      if (theDiv.className=="content")
      {
         var theDivChildren = [ theDiv ];
         while (theDivChildren.length>0)
         {
            var children = theDivChildren.pop().childNodes;
            for (var i in children)
            {
               if (children[i].nodeType == 3) textNodes.push(children[i]);
               else theDivChildren.push(children[i]);
            }
         }
      }
   }
   while (textNodes.length>0)
   {
      var textNode=textNodes.pop();
      var text = textNode.nodeValue;
      if (text.indexOf('_')==-1&&text.indexOf('infodecal')==-1&&text.indexOf('gibshooter')==-1&&text.indexOf('cycler')==-1&&text.indexOf('worldspawn')==-1&&text.indexOf('light')!=-1) continue;
      else
      {
         for (var x in entities)
         {
            var location = text.indexOf(entities[x]);
            if (location!=-1)
            {
               var link = document.createElement("a");
               var textBefore = document.createTextNode(text.substring(0,location));
               var textAfter = document.createTextNode(text.substring(location+entities[x].length));
               link.setAttribute("href", "http://developer.valvesoftware.com/wiki/" + entities[x]);
               link.appendChild(document.createTextNode(entities[x]));
               link.className="postlink";
               textNode.parentNode.insertBefore(textBefore, textNode);
               textNode.parentNode.insertBefore(link, textNode);
               textNode.parentNode.insertBefore(textAfter, textNode);
               textNode.parentNode.removeChild(textNode);
               textNodes.push(textBefore);
               textNodes.push(textAfter);
               break;
            }
         }
      }
   }
}
still not ALL entities though :(*
firefoxusers capable of executing this code will notice how the script takes soo long to process this thread (due to all the entities in the above code) that its an irritation long loading wait / very near to crash the browser.

Doesnt look like a good thing...
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Suggestion: Link tag specifically for VDC

Postby Blink on Tue Mar 23, 2010 3:48 pm

You could probably optimize the looping that code, especially with the DOM manipulation for each item in the loop. Quite expensive.

I wouldn't of thought the long array was enough to crash the browser.
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Re: Suggestion: Link tag specifically for VDC

Postby zombie@computer on Tue Mar 23, 2010 4:36 pm

Code: Select all
function replacewords ()
{
   var divs = document.getElementsByTagName("div");
   var entities=["ai_ally_manager","ai_battle_line","ai_changehintgroup","ai_changetarget","ai_citizen_response_system","ai_goal_actbusy","ai_goal_actbusy queue","ai_goal_assault","ai_goal_follow","ai_goal_lead_weapon","ai_goal_lead","ai_goal_police","ai_goal_standoff","ai_relationship","ai_script_conditions","ai_sound","ai_speechfilter","aiscripted_schedule","assault_assaultpoint","assault_rallypoint","info_apc_missile_hint","info_node_air_hint","info_node_air","info_node_climb","info_node_hint","info_node_link_controller","info_node_link","info_node","info_npc_spawn_destination","info_snipertarget","logic_choreographed_scene","path_corner_crash","path_corner","path_track","scripted_scene","scripted_sentence","scripted_sequence","scripted_target","tanktrain_aitarget","tanktrain_ai","env_ar2explosion","env_beam","env_beverage","env_blood","env_bubbles","env_citadel_energy_core","env_credits","env_cubemap","env_dustpuff","env_effectscript","env_embers","env_entity_dissolver","env_entity_igniter","env_entity_maker","env_explosion","env_extinguisherjet","env_fade","env_firesensor","env_firesource","env_fire","env_flare","env_fog_controller","env_funnel","env_global","env_gunfire","env_headcrabcanister","env_hudhint","env_laser","env_lightglow","env_message","env_microphone","env_muzzleflash","env_particlelight","env_particlescript","env_physexplosion","env_physimpact","env_player_surface_trigger","env_rotorshooter","env_rotorwash","env_screenoverlay","env_shake","env_shooter","env_smokestack","env_smoketrail","env_soundscape_proxy","env_soundscape_triggerable","env_soundscape","env_spark","env_speaker","env_splash","env_spritetrail","env_sprite","env_starfield","env_steam","env_sun","env_terrainmorph","env_texturetoggle","env_tonemap_controller","env_wind","env_zoom","filter_activator_class","filter_activator_name","filter_activator_team","filter_damage_type","filter_multi","func_areaportalwindow","func_areaportal","func_breakable_surf","func_breakable","func_brush","func_button","func_capturezone","func_changeclass","func_clip_vphysics","func_combine_ball_spawner","func_conveyor","func_detail","func_door_rotating","func_door","func_dustcloud","func_dustmotes","func_extinguishercharger","func_guntarget","func_healthcharger","func_illusionary","func_ladderendpoint","func_ladder","func_lod","func_lookdoor","func_monitor","func_movelinear","func_nobuild","func_nogrenades","func_occluder","func_physbox_multiplayer","func_physbox","func_platrot","func_precipitation","func_proprespawnzone","func_recharge","func_reflective_glass","func_regenerate","func_respawnroom","func_respawnroomvisualizer","func_rot_button","func_rotating","func_smokevolume","func_tankairboatgun","func_tankapcrocket","func_tanklaser","func_tankmortar","func_tankphyscannister","func_tankpulselaser","func_tankrocket","func_tanktrain","func_tank","func_trackautochange","func_trackchange","func_tracktrain","func_traincontrols","func_useableladder","func_vehicleclip","func_viscluster","func_wall_toggle","func_water_analog","func_wall","worldspawn","game_end","game_player_equip","game_player_team","game_ragdoll_manager","game_score","game_text","game_ui","game_weapon_manager","game_zone_player","info_camera_link","info_constraint_anchor","info_hint","info_intermission","info_ladder_dismount","info_landmark","info_lighting","info_mass center","info_no_dynamic_shadow","info_node_air hint","info_node_air","info_node_climb","info_node_hint","info_node_link","info_node_link_controller","info_node","info_npc_spawn_destination","info_null","info_overlay","info_particle_system","info_player_combine","info_player_deathmatch","info_player_logo","info_player_rebel","info_player_start","info_projecteddecal","info_snipertarget","info_target_gunshipcrash","info_target","info_teleporter_countdown","info_teleport_destination","infodecal","item_ammo_357_large","item_ammo_357","item_ammo_ar2_altfire","item_ammo_ar2_large","item_ammo_ar2","item_ammo_crate","item_ammo_crossbow","item_ammo_pistol_large","item_ammo_pistol","item_ammo_smg1_grenade","item_ammo_smg1_large","item_ammo_smg1","item_battery","item_box_buckshot","item_dynamic resupply","item_healthcharger","item_healthkit","item_healthvial","item_item_crate","item_rpg_round","item_suitcharger","item_suit","light_dynamic","light_environment","light_spot","light","logic_auto","logic_autosave","logic_branch","logic_case","logic_collision_pair","logic_compare","logic_lineto","logic_measure_movement","logic_multicompare","logic_navigation","logic_relay","logic_timer","ambient_generic","cycler","gibshooter","keyframe_rope","keyframe_track","material_modify_control","math_colorblend","math_counter","math_remap","momentary_rot_button","move_keyframed","move_rope","move_track","script_intro","script_tauremoval","shadow_control","sky_camera","test_sidelist","test_traceline","vgui_screen","water_lod_control","combine_mine","npc_alyx","npc_antlion_template_maker","npc_antlionguard","npc_antlion","npc_barnacle","npc_barney","npc_breen","npc_citizen","npc_combine_camera","npc_combine_s","npc_combinedropship","npc_combinegunship","npc_crabsynth","npc_cranedriver","npc_crow","npc_cscanner","npc_dog","npc_eli","npc_fastzombie","npc_fisherman","npc_gman","npc_headcrab","npc_headcrab_black","npc_headcrab_fast","npc_helicopter","npc_ichthyosaur","npc_kleiner","npc_manhack","npc_metropolice","npc_monk","npc_mortarsynth","npc_mossman","npc_pigeon","npc_poisonzombie","npc_rollermine","npc_seagull","npc_sniper","npc_stalker","npc_strider","npc_turret_ceiling","npc_turret_floor","npc_turret_ground","npc_vortigaunt","npc_zombie","npc_zombie_torso","cycler_actor","generic_actor","info_npc_spawn_destination","monster_generic","npc_apcdriver","npc_bullseye","npc_enemyfinder","npc_furniture","npc_heli_avoidbox","npc_heli_avoidsphere","npc_heli_nobomb","npc_launcher","npc_maker","npc_missiledefense","npc_particlestorm","npc_spotlight","npc_template_maker","npc_vehicledriver","phys_ballsocket","phys_constraintsystem","phys_constraint","phys_convert","phys_hinge","phys_keepupright","phys_lengthconstraint","phys_magnet","phys_motor","phys_pulleyconstraint","phys_ragdollconstraint","phys_ragdollmagnet","phys_slideconstraint","phys_spring","phys_thruster","phys_torque","physics_cannister","player_loadsaved","player_speedmod","player_weaponstrip","point_anglesensor","point_angularvelocitysensor","point_antlion_repellant","point_apc_controller","point_bugbait","point_camera","point_clientcommand","point_commentary_node","point_devshot_camera","point_enable_motion_fixup","point_hurt","point_message","point_playermoveconstraint","point_servercommand","point_spotlight","point_teleport","point_template","point_tesla","point_viewcontrol","vehicle_viewcontroller","prop_combine_ball","prop_detail","prop_door_rotating","prop_dynamic_ornament","prop_dynamic_override","prop_dynamic","prop_physics_multiplayer","prop_physics_override","prop_physics","prop_ragdoll","prop_static","prop_thumper","prop_vehicle_airboat","prop_vehicle_apc","prop_vehicle_cannon","prop_vehicle_crane","prop_vehicle_driveable","prop_vehicle_jeep","prop_vehicle_prisoner_pod","prop_vehicle","trigger_autosave","trigger_changelevel","trigger_finale","trigger_gravity","trigger_hurt","trigger_impact","trigger_look","trigger_multiple","trigger_once","trigger_physics_trap","trigger_playermovement","trigger_proximity","trigger_push","trigger_remove","trigger_rpgfire","trigger_soundscape","trigger_teleport","trigger_transition","trigger_vphysics_motion","trigger_waterydeath","trigger_weapon_dissolve","trigger_weapon_strip","trigger_wind","weapon_357","weapon_alyxgun","weapon_annabelle","weapon_ar2","weapon_brickbat","weapon_bugbait","weapon_citizenpackage","weapon_citizensuitcase","weapon_crossbow","weapon_crowbar","weapon_extinguisher","weapon_frag","weapon_physcannon","weapon_physgun","weapon_pistol","weapon_rpg","weapon_shotgun","weapon_smg1","weapon_stunstick"];
   var textNodes=[];
   for(var d in divs)
   {
      var theDiv = divs[d];
      if (theDiv.className=="content")
      {
         var theDivChildren = [ theDiv ];
         while (theDivChildren.length>0)
         {
            var children = theDivChildren.pop().childNodes;
            for (var i in children)
            {
               if (children[i].nodeType == 3) textNodes.push(children[i]);
               else theDivChildren.push(children[i]);
            }
         }
      }
   }
   while (textNodes.length>0)
   {
      var textNode=textNodes.pop();
      var text = textNode.nodeValue;
      if (text.indexOf('_')==-1&&text.indexOf('infodecal')==-1&&text.indexOf('gibshooter')==-1&&text.indexOf('cycler')==-1&&text.indexOf('worldspawn')==-1&&text.indexOf('light')!=-1) continue;
      else
      {
         for (var x in entities)
         {
            var location = text.indexOf(entities[x]);
            if (location!=-1)
            {
               var link = document.createElement("a");
               var textBefore = document.createTextNode(text.substring(0,location));
               link.setAttribute("href", "http://developer.valvesoftware.com/wiki/" + entities[x]);
               link.appendChild(document.createTextNode(entities[x]));
               link.className="postlink";
               var p = textNode.parentNode;
               textNode.nodeValue=text.substring(location+entities[x].length);
               p.insertBefore(textBefore, textNode);
               p.insertBefore(link, textNode);
               textNodes.push(textNode);
               textNodes.push(textBefore);
               break;
            }
         }
      }
   }
}
a bit faster.

apparently javascript is a fucking lot slower when executed from the url bar. when executed normally theres no problems (does seem to take a second to process tho). strange...

edit: fixed typo's
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Suggestion: Link tag specifically for VDC

Postby zombie@computer on Tue Mar 23, 2010 5:15 pm

When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Suggestion: Link tag specifically for VDC

Postby krainert on Tue Mar 23, 2010 6:27 pm

Awesome :)
http://www.interlopers.net/forum/testreplacements.htm - exactly. Except there you actually replaced inside code tags which may, as suggested, be a problem in some cases.
User avatar
krainert
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Dec 20, 2007 2:57 pm
Location: Denmark

Re: Suggestion: Link tag specifically for VDC

Postby Gary on Tue Mar 23, 2010 11:21 pm

Awesome! Very useful. I look forward to seeing it in use on the entire forum.

Also, I don't see how it will be a problem with seeing them in code tags.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Suggestion: Link tag specifically for VDC

Postby krainert on Tue Mar 23, 2010 11:36 pm

Gary wrote:Also, I don't see how it will be a problem with seeing them in code tags.

Mostly it probably won't, but when writing code, odd strings pop up from time to time, and having a completely unrelated piece of text spontaneously turned into a link referring to some entity with no connection to the subject might be a slight inconvenience ;)
User avatar
krainert
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Thu Dec 20, 2007 2:57 pm
Location: Denmark
Next

Return to Feedback Corner

Who is online

Users browsing this forum: No registered users

cron