Browse Source

add translate attributes

Gregg Tavares 5 years ago
parent
commit
5c52e7f38a
2 changed files with 6 additions and 2 deletions
  1. 1 1
      build/templates/example.template
  2. 5 1
      threejs/lessons/resources/lesson.js

+ 1 - 1
build/templates/example.template

@@ -1,4 +1,4 @@
-<div class="threejs_example_container">
+<div translate="no" class="threejs_example_container">
   <div><iframe class="threejs_example" style="{{width}} {{height}}" src="/threejs/resources/editor.html?url={{{examplePath}}}{{{encodedUrl}}}{{{params}}}"></iframe></div>
   <div><iframe class="threejs_example" style="{{width}} {{height}}" src="/threejs/resources/editor.html?url={{{examplePath}}}{{{encodedUrl}}}{{{params}}}"></iframe></div>
   <a class="threejs_center" href="{{{examplePath}}}{{{url}}}" target="_blank">{{{caption}}}</a>
   <a class="threejs_center" href="{{{examplePath}}}{{{url}}}" target="_blank">{{{caption}}}</a>
 </div>
 </div>

+ 5 - 1
threejs/lessons/resources/lesson.js

@@ -355,11 +355,15 @@ $(document).ready(function($){
   $('pre>code')
   $('pre>code')
     .unwrap()
     .unwrap()
     .replaceWith(function() {
     .replaceWith(function() {
-      return $('<pre class="prettyprint showlinemods">' + this.innerHTML + '</pre>');
+      return $('<pre class="prettyprint showlinemods" translate="no">' + this.innerHTML + '</pre>');
     });
     });
   if (window.prettyPrint) {
   if (window.prettyPrint) {
     window.prettyPrint();
     window.prettyPrint();
   }
   }
+  $('span[class=com]')
+    .replaceWith(function() {
+      return $('<span class="com" translate="yes">' + this.innerHTML + '</span>');
+    });
 
 
   const params = getQueryParams();
   const params = getQueryParams();
   if (params.doubleSpace || params.doublespace) {
   if (params.doubleSpace || params.doublespace) {