]> git.parisson.com Git - telemeta.git/commitdiff
Added licenze header in the js files, fixed some minor stuff, tested on IE7, IE8...
authorriccardo <riccardo@parisson.com>
Mon, 16 May 2011 19:45:46 +0000 (21:45 +0200)
committerriccardo <riccardo@parisson.com>
Mon, 16 May 2011 19:45:46 +0000 (21:45 +0200)
14 files changed:
telemeta/htdocs/js/application.js
telemeta/htdocs/js/locale.js
telemeta/htdocs/js/playlist.js
telemeta/htdocs/js/popupdiv.js
telemeta/htdocs/timeside/js/divmarker.js
telemeta/htdocs/timeside/js/markermap.js
telemeta/htdocs/timeside/js/player.js
telemeta/htdocs/timeside/js/playerLoader.js
telemeta/htdocs/timeside/js/ruler.js
telemeta/htdocs/timeside/js/rulermarker.js
telemeta/htdocs/timeside/js/timeside.js
telemeta/templates/telemeta_default/mediaitem_add.html
telemeta/templates/telemeta_default/mediaitem_detail.html
telemeta/templates/telemeta_default/mediaitem_edit.html

index 26f4bff11e9264e88a0cb28e74600aed4ca85a03..decd3cfde7698aa4f71ea46785807eec83b9fe4c 100644 (file)
@@ -1,57 +1,65 @@
+/*\r
+ * Copyright (C) 2007-2011 Parisson\r
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>\r
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>\r
+ *\r
+ * This file is part of TimeSide.\r
+ *\r
+ * TimeSide is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * TimeSide is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>\r
+ *          Olivier Guilyardi <olivier@samalyse.com>\r
+ */\r
+\r
+/**\r
+ * Class for telemeta global functions.\r
+ * Note that the dollar sign is a reserved keyword in some browsers\r
+ * (see http://davidwalsh.name/dollar-functions)\r
+ * which might be in conflict with jQuery dollar sign.\r
+ */\r
 \r
-//Class for global functions.\r
-//Note that the dollar sign is a reserved keyword in some browsers\r
-//(see http://davidwalsh.name/dollar-functions)\r
-//which might be in conflict with jQuery dollar sign\r
 \r
-//PENDING: use static method?\r
-//adds a move function to the array object.\r
-//moves the element at position from into to position\r
-//returns from if no move was accomplished, ie when either:\r
-//1) from or to are not integers\r
-//2) from==to or from==to-1 (also in this latter case there is no need to move)\r
-//3) from or to are lower than zero or greater than the array length\r
-//in any other case, returns to\r
-//Array.prototype.move = function(from, to){\r
-//    var pInt = parseInt;\r
-//    if(pInt(from)!==from || pInt(to)!==to){\r
-//        return from;\r
-//    }\r
-//    var len = this.length;\r
-//    if((from<0 || from>len)||(to<0 || to>len)){\r
-//        return from;\r
-//    }\r
-//    //if we moved left to right, the insertion index is actually\r
-//    //newIndex-1, as we must also consider to remove the current index markerIndex, so:\r
-//    if(to>from){\r
-//        to--;\r
-//    }\r
-//    if(from != to){\r
-//        var elm = this.splice(from,1)[0];\r
-//        this.splice(to,0,elm);\r
-//        return to;\r
-//    }\r
-//    return from;\r
-//}\r
 \r
+//returns the full path of the current url location removing the last slash '/' followed by one or more '#', if any\r
+function urlNormalized(){\r
+    var sPath = window.location.href;\r
+    sPath = sPath.replace(/\/#*$/,"");\r
+    return sPath;\r
+}\r
+/**\r
+ *sets up few stuff when the page is ready (see functions below it)\r
+ */\r
+jQuery(document).ready(function() {\r
+    foldInfoBlocks();\r
+    setSelectedMenu();\r
+});\r
+\r
+/**\r
+ *function inherited from old code, never touched. Guess fixes the left data table, if any\r
+ */\r
 function foldInfoBlocks() {\r
     var $J = jQuery;\r
     var extra = $J('.extraInfos');\r
     extra.find('.folded dl, .folded table').css('display', 'none');\r
-    extra.find('a').click(function() { \r
+    extra.find('a').click(function() {\r
         $J(this).parents('.extraInfos').children().toggleClass('folded').find('dl, table').toggle(100);\r
-        return false; \r
+        return false;\r
     });\r
 }\r
-//returns the full path of the current url location removing the last slash '/' followed by one or more '#', if any\r
-function urlNormalized(){\r
-    var sPath = window.location.href;\r
-    sPath = sPath.replace(/\/#*$/,"");\r
-    return sPath;\r
-}\r
 \r
 /**\r
- * Global telemeta function to set the current selected menu active according toi the current url\r
+ * Global telemeta function which sets the current selected menu according to the current url\r
  */\r
 function setSelectedMenu(){\r
     var $J = jQuery;\r
@@ -101,38 +109,35 @@ function setSelectedMenu(){
 }\r
 \r
 \r
-jQuery(document).ready(function() {\r
-    foldInfoBlocks();\r
-    setSelectedMenu();\r
-});\r
 \r
-//****************************************************************************\r
-//json(param, method, onSuccesFcn(data, textStatus, jqXHR), onErrorFcn(jqXHR, textStatus, errorThrown))\r
-//global function to senbd/retrieve data with the server\r
-//\r
-//param: the data to be sent or retrieved.\r
-//  param will be converted to string, escaping quotes newlines and backslashes if necessary.\r
-//  param can be a javascript string, boolean, number, dictionary and array.\r
-//      If dictionary or array, it must contain only the above mentioned recognized types.\r
-//      So, eg, {[" a string"]} is fine, {[/asd/]} not\r
-//\r
-//method: the json method, eg "telemeta.update_marker". See base.py\r
-//\r
-//onSuccesFcn(data, textStatus, jqXHR) OPTIONAL --IF MISSING, NOTHING HAPPENS --\r
-//   A function to be called if the request succeeds with the same syntax of jQuery's ajax onSuccess function.\r
-//   The function gets passed three arguments \r
-//      The data returned from the server, formatted according to the dataType parameter;\r
-//      a string describing the status;\r
-//      and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object\r
-//\r
-//onErrorFcn(jqXHR, textStatus, errorThrown) OPTIONAL. --IF MISSING, THE DEFAULT ERROR DIALOG IS SHOWN--\r
-//    A function to be called if the request fails with the same syntax of jQuery ajax onError function..\r
-//    The function receives three arguments:\r
-//      The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object,\r
-//      a string describing the type of error that occurred and\r
-//      an optional exception object, if one occurred.\r
-//      Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror".\r
-//****************************************************************************\r
+\r
+/*****************************************************************************\r
+ * json(param, method, onSuccesFcn(data, textStatus, jqXHR), onErrorFcn(jqXHR, textStatus, errorThrown))\r
+ * global function to senbd/retrieve data with the server\r
+ *\r
+ * param: the data to be sent or retrieved.\r
+ *   param will be converted to string, escaping quotes newlines and backslashes if necessary.\r
+ *   param can be a javascript string, boolean, number, dictionary and array.\r
+ *       If dictionary or array, it must contain only the above mentioned recognized types.\r
+ *       So, eg, {[" a string"]} is fine, {[/asd/]} not\r
+ *\r
+ * method: the json method, eg "telemeta.update_marker". See base.py\r
+ *\r
+ * onSuccesFcn(data, textStatus, jqXHR) OPTIONAL --IF MISSING, NOTHING HAPPENS --\r
+ *    A function to be called if the request succeeds with the same syntax of jQuery's ajax onSuccess function.\r
+ *    The function gets passed three arguments\r
+ *       The data returned from the server, formatted according to the dataType parameter;\r
+ *       a string describing the status;\r
+ *       and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object\r
+ *\r
+ * onErrorFcn(jqXHR, textStatus, errorThrown) OPTIONAL. --IF MISSING, THE DEFAULT ERROR DIALOG IS SHOWN--\r
+ *     A function to be called if the request fails with the same syntax of jQuery ajax onError function..\r
+ *     The function receives three arguments:\r
+ *       The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object,\r
+ *       a string describing the type of error that occurred and\r
+ *       an optional exception object, if one occurred.\r
+ *       Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror".\r
+ * ****************************************************************************/\r
 \r
 var json = function(param,method,onSuccessFcn,onErrorFcn){\r
     //this function converts a javascript object to a string\r
@@ -165,20 +170,15 @@ var json = function(param,method,onSuccessFcn,onErrorFcn){
         }\r
         return string;\r
     };\r
-    //var g = 9;\r
-    //creating the string to send. We use array join and string concatenation with +=\r
-    //as it is more efficient\r
+    \r
+    //creating the string to send. \r
     var param2string = toString_(param);\r
     var data2send = '{"id":"jsonrpc", "params":';\r
     data2send+=param2string;\r
     data2send+=', "method":"'\r
     data2send+=method;\r
     data2send+='","jsonrpc":"1.0"}';\r
-    //        var data2send = '{"id":"jsonrpc", "params":[{"item_id":"'+ s(itemid)+\r
-    //            '", "public_id": "'+s(marker.id)+'", "time": "'+s(offset)+\r
-    //            '", "author": "'+s(marker.author)+\r
-    //            '", "title": "'+s(marker.title)+\r
-    //            '","description": "'+s(marker.desc)+'"}], "method":"'+method+'","jsonrpc":"1.0"}';\r
+    \r
     var $J = jQuery;\r
     $J.ajax({\r
         type: "POST",\r
@@ -208,6 +208,10 @@ var json = function(param,method,onSuccessFcn,onErrorFcn){
     });\r
 \r
 };\r
+\r
+/**\r
+ * Returns an uniqid by creating the current local time in millisecond + a random number. Used for markers and some json calls\r
+ */\r
 var uniqid = function() {\r
     var d = new Date();\r
     return new String(d.getTime() + '' + Math.floor(Math.random() * 1000000)).substr(0, 18);\r
@@ -275,7 +279,7 @@ function loadScripts(){
     }\r
 \r
     var $J = jQuery;\r
-    //var time = new Date().getTime();\r
+   \r
     if(loadInSeries){\r
         var load = function(index){\r
             if(index<len){\r
@@ -303,7 +307,9 @@ function loadScripts(){
 }\r
 \r
 \r
-\r
+/**\r
+ * function for writing to the console. Catches errors, if any (eg, console == undefined)\r
+ */\r
 function consolelog(text){\r
     if(typeof console != 'undefined'){\r
         var c = console;\r
index f655e59dd4b29e92c2f51a4cab20246c1ee45ac1..1c45d25375b7bdf5a853d12c34a0355ee7e1961c 100644 (file)
@@ -1,8 +1,23 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli <riccardo.zaccarelli gmail.com>
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * 
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
  */
 
 /**
index 099e2e188e6b22d428a967ca5100ac8292dcaf8c..d3f7a61d78e387bc379ee0f40fd359dd45743818 100644 (file)
@@ -1,8 +1,23 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli <riccardo.zaccarelli gmail.com>
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
  */
 
 /**
index 01d99d950907244204e4f89dea6e0c8e17944382..bf50f21e9f8f89cec9ca89d878f755874a84ece3 100644 (file)
@@ -1,12 +1,27 @@
-/**\r
- * TimeSide - Web Audio Components\r
- * Copyright (c) 2011 Parisson\r
- * Author: Riccardo Zaccarelli\r
- * License: GNU General Public License version 2.0\r
+/*\r
+ * Copyright (C) 2007-2011 Parisson\r
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>\r
+ *\r
+ * This file is part of TimeSide.\r
+ *\r
+ * TimeSide is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * TimeSide is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * Author: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>\r
  */\r
 \r
 /**\r
- * class for showing non-modal dialogs such as popups or combo lists\r
+ * class for showing non-modal dialogs such as popups or combo lists. Requires jQuery\r
  */\r
 function PopupDiv(){\r
     var $J = jQuery;\r
index 190a313cf06ad1a62ad1bb5be4376dd0fc87418c..c3fb3b65febea5cfea713ae0e531a0f855468d92 100644 (file)
@@ -1,12 +1,27 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
  */
 
 /**
- * Class for showing/editing a marker on details. 
+ * Class representing a marker div html element for showing/editing a marker on details.
  */
 var MarkerMapDiv = TimesideArray.extend({
     init:function(){
@@ -214,8 +229,8 @@ var MarkerMapDiv = TimesideArray.extend({
         var e_descriptionText = div.find('.markersdivDescription');
         var e_titleText = div.find('.markersdivTitle');
 
-        //set defualt element values regardeless of the marker state
-        e_indexLabel.attr('title',marker.toString());
+        //set defualt element values regardeless of the marker state (for debugging, comment it if not needed)
+        //e_indexLabel.attr('title',marker.toString());
         this.setIndex(div, index);
             
         //e_offsetLabel.html(this.makeTimeLabel(marker.offset));
index 8132b6e438adbf8baeef70bc8e06a145fdf478b9..f25c21bbfc9606131bead3b9a35dc3401acac29c 100644 (file)
@@ -1,8 +1,25 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
  */
 
 /**
index e69b94c5447412d6905cc340471228eba75ea9f0..bab1012c090156ebc2e0db4aff1de235758a6dab 100644 (file)
@@ -1,3 +1,26 @@
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
+ */
 var Player = TimesideClass.extend({
     
     //sound duration is in milliseconds because the soundmanager has that unit,
index c69363fec318facfbe36ad4196c8b693590245a0..82c15c0edc07cbeaa9e41fc033b2149323154152 100644 (file)
@@ -1,8 +1,25 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli <riccardo.zaccarelli gmail.com> and Olivier Guilyardi <olivier samalyse com>
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
  */
 
 /**
index 80d19f7b27404727e05347997c1e783a38df8f9a..78ce4bf8a929246da8c3dc114ef6c9a14eacd433 100644 (file)
@@ -1,4 +1,31 @@
-
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
+ */
+
+/**
+ * Class representing the ruler (upper part) of the player. Requires jQuery
+ * wz_jsgraphics.
+ */
 var Ruler = TimesideArray.extend({
     //init constructor: soundDuration is IN SECONDS!!! (float)
     init: function(viewer, soundDuration){
@@ -51,7 +78,7 @@ var Ruler = TimesideArray.extend({
 
 
         var i, ii = sectionSteps.length;
-        var timeLabelWidth = this._textWidth('00:00', fontSize);
+        var timeLabelWidth = this.textWidth('00:00', fontSize);
         for (i = 0; i < ii; i++) {
             var tempDuration = sectionSteps[i][0];
             var subDivision = sectionSteps[i][1];
index 0864345269c38dca1c4f23dac4fc1ce5eb964eaf..4ef2e512d9db81c47ab6f907a5c88f82c15a7034 100644 (file)
@@ -1,13 +1,30 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli <riccardo.zaccarelli gmail.com> and Olivier Guilyardi <olivier samalyse com>
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
  */
 
 /**
  * Class representing a RulerMarker in TimesideUI
- * Requires jQuery and all associated player classes
+ * Requires jQuery wz_jsgraphics and all associated player classes
  */
 
 var RulerMarker = TimesideClass.extend({
@@ -91,81 +108,6 @@ var RulerMarker = TimesideClass.extend({
             return label;
         }
         
-      
-        //CODE HERE BELOW IS EXECUTED ONLY IF THE MARKER HAS CAN MOVE IMPLEMENTED (see Ruler???).
-        //Otherwise, no mouse event can call these methods
-        //re-implement function move
-        //        var position = 0;
-        //        var relativePosition = 0; //position in percentage of container width, set it in move and use it in refreshPosition
-        //
-        //        var mRound = Math.round; //instantiate the functio once
-
-        //        this.move = function(pixelOffset) {
-        //            var width =  viewer.width();
-        //            if (position != pixelOffset) {
-        //                if (pixelOffset < 0) {
-        //                    pixelOffset = 0;
-        //                } else if (pixelOffset >= width) {
-        //                    pixelOffset = width - 1;
-        //                }
-        //                nodes.each(function(i, node) {
-        //                    $J(node).css('left', mRound(node.originalPosition + pixelOffset) + 'px');
-        //                });
-        //                position = pixelOffset;
-        //                this.refreshLabelPosition(width);
-        //                //store relative position (see refreshPosition below)
-        //                relativePosition = pixelOffset == width-1 ? 1 : pixelOffset/width;
-        //            }
-        //            return this;
-        //        };
-        //
-        //        this.refreshLabelPosition = function(optionalContainerWidth){
-        //            if(!(optionalContainerWidth)){
-        //                optionalContainerWidth = viewer.width();
-        //            }
-        //            var width = optionalContainerWidth;
-        //            var pixelOffset = position;
-        //            var labelWidth = label.outerWidth(); //consider margins and padding //label.width();
-        //            var labelPixelOffset = pixelOffset - labelWidth / 2;
-        //            if (labelPixelOffset < 0){
-        //                labelPixelOffset = 0;
-        //            }else if (labelPixelOffset + labelWidth > width){
-        //                labelPixelOffset = width - labelWidth;
-        //            }
-        //            label.css({
-        //                left: mRound(labelPixelOffset) + 'px'
-        //            });
-        //
-        //        };
-        //
-        //        //function called on ruler.resize. Instead of recreating all markers, simply redraw them
-        //        this.refreshPosition = function(){
-        //            var width =  viewer.width();
-        //            //store relativePosition:
-        //            var rp = relativePosition;
-        //            this.move(mRound(relativePosition*width));
-        //            //reset relative position, which does not have to change
-        //            //but in move might have been rounded:
-        //            relativePosition = rp;
-        //            //last thing: resize the vertical line.
-        //            //Assumptions (having a look at the web page element with a debugger and the code above
-        //            //which uses jsgraphics):
-        //            //The line is the first item (see drawLine above)
-        //            //not only the height, but also the height of the clip property must be set
-        //            var h = viewer.height();
-        //            $J(nodes[0]).css({
-        //                'height':h+'px',
-        //                'clip': 'rect(0px 1px '+h+'px 0px)'
-        //            });
-        //        }
-        //
-        //        this.remove = function() {
-        //            painter.clear();
-        //            $J(painter.cnv).remove();
-        //            label.remove();
-        //            return this;
-        //        };
-
         this.getViewer = function(){
             return viewer;
         }
@@ -184,7 +126,7 @@ var RulerMarker = TimesideClass.extend({
         var label = this.getLabel();
         if (label) {
             text += '';
-            var labelWidth = this._textWidth(text, this.getFontSize()) + 10;
+            var labelWidth = this.textWidth(text, this.getFontSize()) + 10;
             var oldWidth = label.width();
             if (oldWidth != labelWidth) {
                 label.css({
index 290d56d02cf31684ec4c8e75a84642b207fe3426..673a39d41e9eca232f252fa6688e7ef95df4720c 100644 (file)
@@ -1,8 +1,25 @@
-/**
- * TimeSide - Web Audio Components
- * Copyright (c) 2011 Parisson
- * Author: Riccardo Zaccarelli <riccardo.zaccarelli gmail.com> and Olivier Guilyardi <olivier samalyse com>
- * License: GNU General Public License version 2.0
+/*
+ * Copyright (C) 2007-2011 Parisson
+ * Copyright (c) 2011 Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ * Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
+ *
+ * This file is part of TimeSide.
+ *
+ * TimeSide is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * TimeSide is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Riccardo Zaccarelli <riccardo.zaccarelli@gmail.com>
+ *          Olivier Guilyardi <olivier@samalyse.com>
  */
 
 /**
  * By John Resig http://ejohn.org/
  * MIT Licensed.
  * (Inspired by base2 and Prototype)
- * 
- * In my (Riccardo) opinion the lightest and most-comprehensive way to implement inhertance and OOP in
- * javascript. Usages can be found below.
+ */
+/*
+ * In few words: the lightest and most-comprehensive way to implement inhertance and OOP in javascript. Usages can be found below.
  * Basically,
  * 1) a new Class is instantiated with Class.extend(). This function takes a dictionary
  * of properties/methods which will be put IN THE PROTOTYPE of the class, so that each instance will share the same properties/methods
 })();
 
 //Defining the base TimeClass class. Player, Ruler, MarkerMap are typical implementations (see js files)
-//Basically we store here static methods which must be accessible
-//in several timside sub-classes
+//Basically we store here static methods which must be accessible in several timside sub-classes
 var TimesideClass = Class.extend({
-    _textWidth : function(text, fontSize) {
+
+    /**
+     * function to calculate the text width according to a text and a given fontsize
+     */
+    textWidth : function(text, fontSize) {
         var ratio = 3/5;
         return text.length * ratio * fontSize;
     },
@@ -226,9 +246,9 @@ var TimesideClass = Class.extend({
         return ret.join("");
     },
 
-    cssPrefix : 'ts-',
+    cssPrefix : 'ts-', //actually almost uneuseful, backward compatibility with old code (TODO: remove?)
     $J : jQuery,
-    debugging : true,
+    debugging : false,
     debug : function(message) {
         if (this.debugging && typeof console != 'undefined' && console.log) {
             console.log(message);
@@ -242,12 +262,10 @@ var TimesideClass = Class.extend({
         //the map for listeners. Must be declared in the init as it's private and NOT shared by all instances
         //(ie, every instance has its own copy)
         this.listenersMap={};
-    //follows jquery bind. Same as adding a listener for a key
-        
     },
 
     /**
-     *methods defining listeners, events fire and bind:
+     * 3 methods defining listeners, events fire and bind (aloing the lines of jQuery.bind, unbind and trigger):
      */
     bind : function(key, callback, optionalThisArgInCallback){
         if(!(callback && callback instanceof Function)){
@@ -297,8 +315,10 @@ var TimesideClass = Class.extend({
 
 });
 
-//re-implemented array for easier access/modification of markers:
-//Ruler, MArkerMap and MarkerMapDiv implement this class
+/**
+ * An Array-like implementation that suits the need of Marker mnanagement
+ * Ruler, MarkerMap and MarkerMapDiv implement this class
+ */
 var TimesideArray = TimesideClass.extend({
     init: function(optionalArray){
         this._super();
@@ -345,7 +365,7 @@ var TimesideArray = TimesideClass.extend({
 
     //NOTE: writing   each : function(startInclusive, endExclusive, callback) throws an error in chrome, as the last 
     //argument (even if it is a function) is a number. Why?????
-    //Anyway, we must write the function arguments as empty
+    //Anyway, we write the function arguments as empty
     each : function(){
         var startInclusive, endExclusive, callback;
 
@@ -449,7 +469,7 @@ var TimesideArray = TimesideClass.extend({
  * setUpPlayerTabs([jQuery('#tab1),jQuery('#tab1)], [jQuery('#div1),jQuery('#div2)], 1);
  * sets the elements with id '#tab1' and '#tab2' as tab and assign the click events to them so that clicking tab_1 will show '#div_1'
  * (and hide '#div2') and viceversa for '#tab2'. The selected index will be 1 (second tab '#tab2')
-*/
+ */
 function setUpPlayerTabs() {//called from within controller.js once all markers have been loaded.
     //this is because we need all divs to be visible to calculate size. selIndex is optional, it defaults to 0
     //
index 5998b0fb53335371cb297af8cee68baddf5155cc..be3eb1a77a03ce33d8bf87c123c29405944574fe 100644 (file)
@@ -35,7 +35,8 @@
         <a href="{% url telemeta-items %}"
            class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
         <a href="#" class="component_icon button icon_save"
-   onclick="document.getElementById('_addItemForm').submit(); return false;">{% trans "Save" %}</a>
+   onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_addItemForm').submit();},300); return false;">{% trans "Save" %}</a>
+           <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="/images/wait.gif"/>
        </div>
      </form>
     </div>
index 5821e615553dae394df215b7b8cf358538a83aa9..7333ec44f92894d96cf3989090eb48fa81045085 100644 (file)
             <span id="loading_span" href="#"><img style="vertical-align:middle" alt="wait" src="/images/wait.gif"/>&nbsp;
                 <span id="loading_span_text">Loading...</span></span>
             <a id="tab_analysis" style="display:none" class ="tab" href="#">{% trans "Analysis" %}</a><!--
-             do not let space here as it appears in the document
+             do not let space here as it appears in the document!!!!!
             --><a id="tab_markers" style="display:none" class="tab" href="#">{% trans "Markers" %}</a>
         </div>
 
index 1dc702519be6ee2f0f13107c115ae583b2516af3..77b151c45a0dfa9614d8b811bdf93800868d4c9d 100644 (file)
@@ -40,8 +40,9 @@
     <div align="center">
     <a href="{% url telemeta-item-detail item.public_id %}"
         class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-    <a href="#" class="component_icon button icon_save"
-onclick="document.getElementById('_editItemForm').submit(); return false;">{% trans "Save" %}</a>
+    <a href="#" class="component_icon button icon_save" 
+onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_editItemForm').submit();},300); return false;">{% trans "Save" %}</a>
+           <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="/images/wait.gif"/>
     </div>
     </form>
 </div>