浏览代码

Added expansion as seperate js file

Yoginth 7 年之前
父节点
当前提交
760d5e1b56
共有 3 个文件被更改,包括 27 次插入17 次删除
  1. 20 0
      public/expansion/expansion.js
  2. 1 0
      templates/base/head.tmpl
  3. 6 17
      templates/base/info_bar.tmpl

+ 20 - 0
public/expansion/expansion.js

@@ -0,0 +1,20 @@
+var nextWord = (function() {
+    var wordArray = [
+        'Gitote Is Tasty',
+        'Get In Touch',
+        'Get It Tested',
+        'GNU Interactive Tools',
+        'Goods In Transit',
+        'Geek In Training',
+        'Goddess In Training',
+        'Gentleman In Training',
+        'Geologist In Training',
+        'Geeks In Town',
+        'General Information Test'
+    ];
+    var copy;
+    return function() {
+        if (!copy || !copy.length) copy = wordArray.slice();
+        return copy.splice(Math.random() * copy.length | 0, 1);
+    }
+}());

+ 1 - 0
templates/base/head.tmpl

@@ -75,6 +75,7 @@
 
 	<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.js"></script>
 	<script src="https://cdn.jsdelivr.net/npm/gitote@1.3.2/js/gitote.min.js?v={{MD5 AppVer}}"></script>
+	<script src="{{AppURL}}expansion/expansion.js?v={{MD5 AppVer}}"></script>
 
 	{{if not .IsLogged}}
 		{{if .PageIsHome}}

+ 6 - 17
templates/base/info_bar.tmpl

@@ -14,7 +14,12 @@
                 {{end}}
                 <span class="infobar align">
                     <span class="infobar heart">❤</span>
-                    <span id="expansion" class="infobar expansion" onclick="document.getElementById('expansion').innerHTML = nextWord();">Get Into Text</span>
+                    <span 
+                        id="expansion" 
+                        class="infobar expansion" 
+                        onclick="document.getElementById('expansion').innerHTML = nextWord();">
+                        Get It Together
+                    </span>
                 </span>
             </div>
             <div class="ui right floated header infobar text">
@@ -48,19 +53,3 @@
         </div>
     </div>
 </div>
-
-<script>
-    var nextWord = (function() {
-      var wordArray = [
-        'Just in Time',
-        'Gitote is Tasty',
-        'Git it Best',
-        'Git It Test'
-      ];
-      var copy;
-      return function() {
-        if (!copy || !copy.length) copy = wordArray.slice();
-        return copy.splice(Math.random() * copy.length | 0, 1);
-      }
-    }());
-</script>