Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <head>
  2. <script type="text/javascript">
  3.  
  4.  
  5.     function parseflame(flamestring){
  6.     var pm = flamestring.match(/<flame\s+[^>]*>/)[0];  //get <flame ...> string
  7.     alert("function called");
  8.     var attributes = pm.match(/\s+([a-zA-Z0-9_]+)="[^"]*"/g);  //get attributes from flame tag.  
  9.     for(var i in attributes){
  10.         document.write(attributes[i],"<br>");
  11.  
  12.         var attributeNames=attributes[i].match(/[a-zA-Z0-9_]+/)[0];
  13.         document.write("Attribute Name: ", attributeNames,"<br>");
  14.  
  15.         var attributeValues = /"([^"]*)"/g.exec(attributes[i]);
  16.         document.write("Attribute Values: ", attributeValues[1], "<br>");  
  17.         document.write("<br>");
  18.                 }
  19. }
  20. </script>
  21. <script type="text/javascript">
  22. var astring='<flame name="Apophysis7x-110220-1" version="Apophysis 7x Version 15" size="481 603" center="0.287433871944588 -0.0104665524593319" scale="173.3810921581" oversample="1" filter="0.5" quality="50" background="0 0 0" brightness="4" gamma="4" gamma_threshold="0.01" estimator_radius="9" estimator_minimum="0" estimator_curve="0.4" enable_de="0" plugins="" >'
  23. alert(astring);
  24.  
  25. parseflame(astring);
  26. </script>
  27. </head>
  28. <body>
  29. </body>
  30.  
  31.  
  32. ////////////////////////////////////////////////
  33. // RESULTS
  34. ////////////////////////////////////////////////
  35.  
  36.  
  37. name="Apophysis7x-110220-1"
  38. Attribute Name: name
  39. Attribute Values: Apophysis7x-110220-1
  40.  
  41. version="Apophysis 7x Version 15"
  42. Attribute Name: version
  43. Attribute Values: Apophysis 7x Version 15
  44.  
  45. size="481 603"
  46. Attribute Name: size
  47. Attribute Values: 481 603
  48.  
  49. center="0.287433871944588 -0.0104665524593319"
  50. Attribute Name: center
  51. Attribute Values: 0.287433871944588 -0.0104665524593319
  52.  
  53. scale="173.3810921581"
  54. Attribute Name: scale
  55. Attribute Values: 173.3810921581
  56.  
  57. oversample="1"
  58. Attribute Name: oversample
  59. Attribute Values: 1
  60.  
  61. filter="0.5"
  62. Attribute Name: filter
  63. Attribute Values: 0.5
  64.  
  65. quality="50"
  66. Attribute Name: quality
  67. Attribute Values: 50
  68.  
  69. background="0 0 0"
  70. Attribute Name: background
  71. Attribute Values: 0 0 0
  72.  
  73. brightness="4"
  74. Attribute Name: brightness
  75. Attribute Values: 4
  76.  
  77. gamma="4"
  78. Attribute Name: gamma
  79. Attribute Values: 4
  80.  
  81. gamma_threshold="0.01"
  82. Attribute Name: gamma_threshold
  83. Attribute Values: 0.01
  84.  
  85. estimator_radius="9"
  86. Attribute Name: estimator_radius
  87. Attribute Values: 9
  88.  
  89. estimator_minimum="0"
  90. Attribute Name: estimator_minimum
  91. Attribute Values: 0
  92.  
  93. estimator_curve="0.4"
  94. Attribute Name: estimator_curve
  95. Attribute Values: 0.4
  96.  
  97. enable_de="0"
  98. Attribute Name: enable_de
  99. Attribute Values: 0
  100.  
  101. plugins=""
  102. Attribute Name: plugins
  103. Attribute Values:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement