about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-03-20 16:41:21 -0400
committerZach DeCook <zachdecook@gmail.com>2018-03-20 16:41:21 -0400
commit2bef694a6a64c6044292a57029e82a802cd84932 (patch)
tree4d990459c686c474d7be3a0e4d8656abafe44afa
parent9505478bb7630100e076cf70888ab99e51555a78 (diff)
downloadprosongsa-2bef694a6a64c6044292a57029e82a802cd84932.tar.gz
* Prosongsa: Prepare to license
-rw-r--r--functions.js17
-rwxr-xr-xindex.php5
-rw-r--r--page.js12
-rw-r--r--source.php13
4 files changed, 24 insertions, 23 deletions
diff --git a/functions.js b/functions.js
deleted file mode 100644
index 63480a3..0000000
--- a/functions.js
+++ /dev/null
@@ -1,17 +0,0 @@
-function array_flip (trans) { // eslint-disable-line camelcase
-  //  discuss at: http://locutus.io/php/array_flip/
-  // original by: Kevin van Zonneveld (http://kvz.io)
-  // improved by: Pier Paolo Ramon (http://www.mastersoup.com/)
-  // improved by: Brett Zamir (http://brett-zamir.me)
-  //   example 1: array_flip( {a: 1, b: 1, c: 2} )
-  //   returns 1: {1: 'b', 2: 'c'}
-  var key
-  var tmpArr = {}
-  for (key in trans) {
-    if (!trans.hasOwnProperty(key)) {
-      continue
-    }
-    tmpArr[trans[key]] = key
-  }
-  return tmpArr
-}
\ No newline at end of file
diff --git a/index.php b/index.php
index 9520ed3..20aeffd 100755
--- a/index.php
+++ b/index.php
@@ -97,6 +97,11 @@ include 'page.php';
 ?>
 <br/><br><br>
 All songs are owned by their respective copyright holders. No infringement intended.
+<br>
+Powered by <a href='https://github.com/earboxer/prosongsa'>Prosongsa</a>.
+Suggest features <a href='https://github.com/earboxer/prosongsa/issues'>here</a>.
+<br>
+Licensed under the <a href='LICENSE'></a>. View source <a href='source.php'>here</a>.
 </div>
 
 <!-- <script type="text/javascript" src="../scripts/jqm.js"></script> -->
diff --git a/page.js b/page.js
index bb5580d..b7a89f7 100644
--- a/page.js
+++ b/page.js
@@ -99,12 +99,12 @@ function zj_transparray( transp )
 
 function transpadd( fromkey, integer )
 {
-	var chords = array_flip( [ "C","C#","D","D#","E","F","F#","G","G#","A","A#","B" ]);
-	chords["Db"] = chords["C#"];
-	chords["Eb"] = chords["D#"];
-	chords["Gb"] = chords["F#"];
-	chords["Ab"] = chords["G#"];
-	chords["Bb"] = chords["A#"];
+	var chords = {C:0, Db:1, D:2, Eb:3, E:4, F:5, Gb:6, G:7, Ab:8, A:9, Bb:10, B:11};
+	chords["C#"] = chords["Db"];
+	chords["D#"] = chords["Eb"];
+	chords["F#"] = chords["Gb"];
+	chords["G#"] = chords["Ab"];
+	chords["A#"] = chords["Bb"];
 	var ochords = [ "C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B" ];
 
 	var val = ochords[(parseInt(chords[fromkey]) + integer + 24)%12];
diff --git a/source.php b/source.php
new file mode 100644
index 0000000..cbaf9f4
--- /dev/null
+++ b/source.php
@@ -0,0 +1,13 @@
+<?php
+
+$files = scandir('.');
+
+foreach( $files as $file ){
+	if ( strpos($file, '.php') !== FALSE || strpos($file, '.js') !== FALSE )
+	{
+		echo "<h3>$file</h3>";
+		echo '<pre>';
+		echo htmlspecialchars(file_get_contents($file));
+		echo '</pre>';
+	}
+}