src/js/utils.js
branchpopcorn-port
changeset 686 f1dbe6a6e740
parent 650 54ad76d6f9fe
child 720 08b8b3ce30e4
--- a/src/js/utils.js	Fri Jan 20 12:20:36 2012 +0100
+++ b/src/js/utils.js	Fri Jan 20 12:20:51 2012 +0100
@@ -165,6 +165,14 @@
   return url;
 };
 
+/** Similar to substr but remove the last word if
+    we're breaking a word in two.
+ */ 
+IriSP.clean_substr = function(str, start, end) {
+  var s = str.substr(start, end).substr(start, end).split(" ");
+  s.pop();
+  return s.join(" ");
+};
 /* for ie compatibility
 if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
    Object.defineProperty=function(obj,prop,desc) {