diff options
author | sgiehl <stefan@piwik.org> | 2013-04-28 16:51:00 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2013-04-28 16:51:00 +0400 |
commit | 8af5f6443c82e404b9b7855d5978a299bb13d905 (patch) | |
tree | 6dbf44eb1bfdb9205cc7edd6b87fbba2424ac37c /plugins | |
parent | 87916f613fd01b383aad04cdbe4dbf924526d780 (diff) |
converted global js vars to local vars where possible
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/Annotations/templates/annotations.js | 6 | ||||
-rw-r--r-- | plugins/CoreHome/templates/broadcast.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/datatable.js | 20 | ||||
-rw-r--r-- | plugins/CoreHome/templates/datatable_manager.js | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/jqplot.js | 21 | ||||
-rw-r--r-- | plugins/CoreHome/templates/popover.js | 1 | ||||
-rw-r--r-- | plugins/Dashboard/templates/dashboardObject.js | 2 | ||||
-rw-r--r-- | plugins/Goals/templates/GoalForm.js | 2 | ||||
-rw-r--r-- | plugins/Goals/templates/list_goal_edit.tpl | 4 | ||||
-rw-r--r-- | plugins/MultiSites/templates/common.js | 2 | ||||
-rw-r--r-- | plugins/MultiSites/templates/index.tpl | 4 | ||||
-rw-r--r-- | plugins/PDFReports/templates/pdf.js | 2 | ||||
-rw-r--r-- | plugins/PDFReports/templates/report_parameters.tpl | 2 | ||||
-rw-r--r-- | plugins/SegmentEditor/templates/Segmentation.js | 35 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.js | 20 | ||||
-rw-r--r-- | plugins/Transitions/templates/transitions.js | 3 | ||||
-rw-r--r-- | plugins/UsersManager/templates/UsersManager.js | 2 | ||||
-rw-r--r-- | plugins/Widgetize/templates/widgetize.js | 7 |
18 files changed, 72 insertions, 65 deletions
diff --git a/plugins/Annotations/templates/annotations.js b/plugins/Annotations/templates/annotations.js index 85097ad1d6..941ae4486a 100755 --- a/plugins/Annotations/templates/annotations.js +++ b/plugins/Annotations/templates/annotations.js @@ -194,7 +194,7 @@ * attributes. * * @param {Element} manager The annotation manager. - * @param {string} tml The HTML of the new annotation manager. + * @param {string} html The HTML of the new annotation manager. */ var replaceAnnotationManager = function (manager, html) { var newManager = $(html); @@ -208,7 +208,7 @@ * Returns true if an annotation element is starred, false if otherwise. * * @param {Element} annotation The annotation element. - * @return {bool} + * @return {boolean} */ var isAnnotationStarred = function (annotation) { return +$('.annotation-star', annotation).attr('data-starred') == 1 ? true : false; @@ -443,7 +443,7 @@ * @param {int} idSite The ID of the site to show the annotations of. * @param {string} date The start date of the period. * @param {string} period The period type. - * @param {int} Whether to include the last N periods in the date range or not. Can + * @param {int} lastN Whether to include the last N periods in the date range or not. Can * be undefined. */ var showAnnotationViewer = function (domElem, idSite, date, period, lastN, callback) { diff --git a/plugins/CoreHome/templates/broadcast.js b/plugins/CoreHome/templates/broadcast.js index 8846123ccf..0301425875 100644 --- a/plugins/CoreHome/templates/broadcast.js +++ b/plugins/CoreHome/templates/broadcast.js @@ -412,7 +412,7 @@ var broadcast = { async: true, error: broadcast.customAjaxHandleError, // Callback when the request fails success: sectionLoaded, // Callback when the request succeeds - data: new Object + data: {} }; globalAjaxQueue.push($.ajax(ajaxRequest)); return false; diff --git a/plugins/CoreHome/templates/datatable.js b/plugins/CoreHome/templates/datatable.js index a0ea01d103..49725bead6 100644 --- a/plugins/CoreHome/templates/datatable.js +++ b/plugins/CoreHome/templates/datatable.js @@ -71,8 +71,8 @@ dataTable.prototype = //Reset DataTable filters (used before a reload or view change) resetAllFilters: function () { var self = this; - var FiltersToRestore = new Array(); - filters = [ + var FiltersToRestore = []; + var filters = [ 'filter_column', 'filter_pattern', 'filter_column_recursive', @@ -99,7 +99,7 @@ dataTable.prototype = //Restores the filters to the values given in the array in parameters restoreAllFilters: function (FiltersToRestore) { var self = this; - for (key in FiltersToRestore) { + for (var key in FiltersToRestore) { self.param[key] = FiltersToRestore[key]; } }, @@ -454,7 +454,7 @@ dataTable.prototype = var offset = 1 + Number(self.param.filter_offset); var offsetEnd = Number(self.param.filter_offset) + Number(self.param.filter_limit); var totalRows = Number(self.param.totalRows); - offsetEndDisp = offsetEnd; + var offsetEndDisp = offsetEnd; if (self.param.keep_summary_row == 1) --totalRows; @@ -998,12 +998,12 @@ dataTable.prototype = self.param.enable_filter_excludelowpop = 0; } if (Number(self.param.enable_filter_excludelowpop) != 0) { - string = getText('CoreHome_IncludeRowsWithLowPopulation_js', true); + var string = getText('CoreHome_IncludeRowsWithLowPopulation_js', true); self.param.enable_filter_excludelowpop = 1; iconHighlighted = true; } else { - string = getText('CoreHome_ExcludeRowsWithLowPopulation_js'); + var string = getText('CoreHome_ExcludeRowsWithLowPopulation_js'); self.param.enable_filter_excludelowpop = 0; } $(this).html(string); @@ -1858,7 +1858,7 @@ actionDataTable.prototype = } var re = /subDataTable_(\d+)/; - ok = re.exec(self.parentId); + var ok = re.exec(self.parentId); if (ok) { self.parentId = ok[1]; } @@ -1889,11 +1889,11 @@ function getLevelFromClass(style) { //helper function for actionDataTable function getNextLevelFromClass(style) { if (!style || typeof style == "undefined") return 0; - currentLevel = getLevelFromClass(style); - newLevel = currentLevel; + var currentLevel = getLevelFromClass(style); + var newLevel = currentLevel; // if this is not a row to process so if (style.indexOf('rowToProcess') < 0) { - newLevel = currentLevel + 1; + newLevel = currentLevel + 1; } return newLevel; } diff --git a/plugins/CoreHome/templates/datatable_manager.js b/plugins/CoreHome/templates/datatable_manager.js index 517262d9d2..f8330ebbcf 100644 --- a/plugins/CoreHome/templates/datatable_manager.js +++ b/plugins/CoreHome/templates/datatable_manager.js @@ -167,7 +167,7 @@ * a specific report. * * @param {string} report The report, eg, UserSettings.getWideScrren - * @return {DataTable} The DataTable instance created for the element, if + * @return {dataTable} The DataTable instance created for the element, if * the element can be found. undefined, if it can't be found. */ getDataTableInstanceByReport: function (report) { diff --git a/plugins/CoreHome/templates/jqplot.js b/plugins/CoreHome/templates/jqplot.js index e188c4e023..a63a0d33c0 100644 --- a/plugins/CoreHome/templates/jqplot.js +++ b/plugins/CoreHome/templates/jqplot.js @@ -11,7 +11,9 @@ /** * Constructor function - * @param the data that would be passed to open flash chart + * + * @param {object} data the data that would be passed to open flash chart + * @param {int} dataTableId */ function JQPlot(data, dataTableId) { this.init(data, dataTableId); @@ -507,7 +509,7 @@ JQPlot.prototype = { var maxCrossDataSets = 0; for (var i = 0; i < this.data.length; i++) { if (this.params.series[i].yaxis == axisName) { - maxValue = Math.max.apply(Math, this.data[i]); + var maxValue = Math.max.apply(Math, this.data[i]); if (maxValue > maxCrossDataSets) { maxCrossDataSets = maxValue; } @@ -533,9 +535,9 @@ JQPlot.prototype = { } // calculate y-values for ticks - ticks = []; - numberOfTicks = 2; - tickDistance = Math.ceil(maxCrossDataSets / numberOfTicks); + var ticks = []; + var numberOfTicks = 2; + var tickDistance = Math.ceil(maxCrossDataSets / numberOfTicks); for (var i = 0; i <= numberOfTicks; i++) { ticks.push(i * tickDistance); } @@ -577,7 +579,10 @@ JQPlot.prototype = { * Add an external series toggle. * As opposed to addSeriesPicker, the external series toggle can only show/hide * series that are already loaded. + * * @param seriesPickerClass a subclass of JQPlotExternalSeriesToggle + * @param targetDivId + * @param initiallyShowAll */ addExternalSeriesToggle: function (seriesPickerClass, targetDivId, initiallyShowAll) { new seriesPickerClass(targetDivId, this.originalData, initiallyShowAll); @@ -971,7 +976,7 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () { // render series names var x = 0; var series = plot.legend._series; - for (i = 0; i < series.length; i++) { + for (var i = 0; i < series.length; i++) { var s = series[i]; var label; if (legend.labels && legend.labels[i]) { @@ -1377,9 +1382,9 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () { // text if (right) { - x = x2 + 9; + var x = x2 + 9; } else { - x = x2 - 9 - ctx.measureText(label).width; + var x = x2 - 9 - ctx.measureText(label).width; } ctx.fillStyle = '#666666'; diff --git a/plugins/CoreHome/templates/popover.js b/plugins/CoreHome/templates/popover.js index c5d5d039d5..91f9c09ec1 100644 --- a/plugins/CoreHome/templates/popover.js +++ b/plugins/CoreHome/templates/popover.js @@ -187,6 +187,7 @@ var Piwik_Popover = (function () { /** * Create a Popover and load the specified URL in it * @param url + * @param loadingName */ createPopupAndLoadUrl: function (url, loadingName) { // open the popover diff --git a/plugins/Dashboard/templates/dashboardObject.js b/plugins/Dashboard/templates/dashboardObject.js index 7cfca2bdfc..80d74f3e4d 100644 --- a/plugins/Dashboard/templates/dashboardObject.js +++ b/plugins/Dashboard/templates/dashboardObject.js @@ -483,7 +483,7 @@ var columnNumber = 0; $('.col').each(function () { - columns[columnNumber] = new Array; + columns[columnNumber] = []; var items = $('[widgetId]', this); for (var j = 0; j < items.size(); j++) { columns[columnNumber][j] = $(items[j]).dashboardWidget('getWidgetObject'); diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js index f4574bb7c5..fa1d0beceb 100644 --- a/plugins/Goals/templates/GoalForm.js +++ b/plugins/Goals/templates/GoalForm.js @@ -168,6 +168,6 @@ function bindListGoalEdit() { } function initAndShowAddGoalForm() { - initGoalForm('Goals.addGoal', _pk_translate('Goals_AddGoal_js'), '', 'url', '', 'contains', caseSensitive = false, allowMultiple = '0', '0'); + initGoalForm('Goals.addGoal', _pk_translate('Goals_AddGoal_js'), '', 'url', '', 'contains', /*caseSensitive = */false, /*allowMultiple = */'0', '0'); return showAddNewGoal(); } diff --git a/plugins/Goals/templates/list_goal_edit.tpl b/plugins/Goals/templates/list_goal_edit.tpl index 1a412d5f82..cceafc41f8 100644 --- a/plugins/Goals/templates/list_goal_edit.tpl +++ b/plugins/Goals/templates/list_goal_edit.tpl @@ -45,8 +45,8 @@ $(document).ready(function () { // translation of the goal "match attribute" to human readable description $('.matchAttribute').each(function () { - matchAttribute = $(this).text(); - translation = goalTypeToTranslation[matchAttribute]; + var matchAttribute = $(this).text(); + var translation = goalTypeToTranslation[matchAttribute]; $(this).text(translation); }); }); diff --git a/plugins/MultiSites/templates/common.js b/plugins/MultiSites/templates/common.js index 29439401d0..15c8aade97 100644 --- a/plugins/MultiSites/templates/common.js +++ b/plugins/MultiSites/templates/common.js @@ -132,7 +132,7 @@ function switchEvolution(params) { $('.visits').hide(); $('.' + params['evolutionBy']).show(); sitesVisible = params['sitesVisible']; - for (i = 0; i < allSites.length; i++) { + for (var i = 0; i < allSites.length; i++) { $('#sparkline_' + allSites[i].idsite).html(getSparklineImg(allSites[i].idsite, params['evolutionBy'], params)); } } diff --git a/plugins/MultiSites/templates/index.tpl b/plugins/MultiSites/templates/index.tpl index f130594d6e..2ba94ecd81 100644 --- a/plugins/MultiSites/templates/index.tpl +++ b/plugins/MultiSites/templates/index.tpl @@ -7,8 +7,8 @@ <div id="main"> {include file="MultiSites/templates/row.tpl" assign="row"} <script type="text/javascript"> - var allSites = new Array(); - var params = new Array(); + var allSites = []; + var params = []; {foreach from=$sitesData key=i item=site} allSites[{$i}] = new setRowData({$site.idsite}, {$site.visits}, {$site.pageviews}, {if empty($site.revenue)}0{else}{$site.revenue}{/if}, '{$site.name|escape:"javascript"}', '{$site.main_url|escape:"javascript"}', '{if isset($site.visits_evolution)}{$site.visits_evolution|replace:",":"."}{/if}', '{if isset($site.pageviews_evolution)}{$site.pageviews_evolution|replace:",":"."}{/if}', '{if isset($site.revenue_evolution)}{$site.revenue_evolution|replace:",":"."}{/if}'); {/foreach} diff --git a/plugins/PDFReports/templates/pdf.js b/plugins/PDFReports/templates/pdf.js index 4115dcc3f1..75e3ff831b 100644 --- a/plugins/PDFReports/templates/pdf.js +++ b/plugins/PDFReports/templates/pdf.js @@ -145,7 +145,7 @@ function initManagePdf() { $('#linkAddReport').click(function () { $('.entityAddContainer').show(); $('#entityEditContainer').hide(); - formSetEditReport(idReport = 0); + formSetEditReport(/*idReport = */0); }); // Cancel click diff --git a/plugins/PDFReports/templates/report_parameters.tpl b/plugins/PDFReports/templates/report_parameters.tpl index 1d2cb3c04a..9afe1c409c 100644 --- a/plugins/PDFReports/templates/report_parameters.tpl +++ b/plugins/PDFReports/templates/report_parameters.tpl @@ -58,7 +58,7 @@ parameters.emailMe = $('#report_email_me').prop('checked'); parameters.evolutionGraph = $('#report_evolution_graph').prop('checked'); - additionalEmails = $('#report_additional_emails').val(); + var additionalEmails = $('#report_additional_emails').val(); parameters.additionalEmails = additionalEmails != '' ? additionalEmails.split('\n') : []; diff --git a/plugins/SegmentEditor/templates/Segmentation.js b/plugins/SegmentEditor/templates/Segmentation.js index 54ea9d037c..d18dc9ee47 100644 --- a/plugins/SegmentEditor/templates/Segmentation.js +++ b/plugins/SegmentEditor/templates/Segmentation.js @@ -401,9 +401,8 @@ Segmentation = (function($) { var parents = $(select).parents('.segment-row'); var loadingElement = parents.find(".segment-loading"); loadingElement.show(); - currentValue = parents.find(".metricValueBlock input").val(); - inputElement = parents.find(".metricValueBlock input"); - segmentName = $('option:selected',select).attr('value'); + var inputElement = parents.find(".metricValueBlock input"); + var segmentName = $('option:selected',select).attr('value'); // Request auto-suggest values var ajaxHandler = new ajaxHelper(); @@ -437,12 +436,12 @@ Segmentation = (function($) { var type = $(select).find("option:selected").attr("data-type"); var matchSelector = $(select).parents(".segment-input").siblings(".metricMatchBlock").find("select"); if(persist === true){ - oldMatch = matchSelector.find("option:selected").val(); + oldMatch = matchSelector.find("option:selected").val(); } else{ oldMatch = ""; } - + if(type === "dimension" || type === "metric"){ matchSelector.empty(); var optionsHtml = ""; @@ -450,7 +449,7 @@ Segmentation = (function($) { optionsHtml += '<option value="'+key+'">'+self.availableMatches[type][key]+'</option>'; } } - + matchSelector.append(optionsHtml); matchSelector.val(oldMatch); } @@ -591,7 +590,7 @@ Segmentation = (function($) { $("#segmentList").show(); self.form.unbind().remove(); }); - + $("body").on("keyup", function(e){ if(e.keyCode == "27"){ $("#segmentList").show(); @@ -663,7 +662,7 @@ Segmentation = (function($) { $(this).show(); } }); - + var curMetric = ""; // 2 - among all unselected categories find metrics which match and mark parent as search result $(self.form).find(".segment-nav div > ul > li:not(.searchFound)").each(function(){ @@ -678,7 +677,7 @@ Segmentation = (function($) { $(parent).addClass("searchFound").show(); } }); - + // if(curStr.indexOf(search) > -1 || curMetric.indexOf(search) > -1) // { // $(this).addClass("searchFound"); @@ -773,7 +772,7 @@ Segmentation = (function($) { } var addForm = function(mode){ - + $("#segmentEditorPanel").find(".segment-element:visible").unbind().remove(); if(typeof self.form !== "undefined") { @@ -895,7 +894,7 @@ Segmentation = (function($) { $(this).autocomplete( "search", "" ); }); - $('body').on('mouseup',function(e){ + $('body').on('mouseup',function(e){ if(!$(e.target).parents(spanId).length && !$(e.target).is(spanId) && !$(e.target).parents(spanId).length && !$(e.target).parents(".ui-autocomplete").length && !$(e.target).is(".ui-autocomplete") && !$(e.target).parents(".ui-autocomplete").length ) { @@ -915,7 +914,7 @@ Segmentation = (function($) { self.content.unbind(); } var html = getListHtml(); - + if(typeof self.content !== "undefined"){ self.content.html($(html).html()); } else { @@ -1019,18 +1018,18 @@ $(document).ready( function(){ "currentSegmentStr": broadcast.getValueFromHash('segment'), "currentSegmentsGlobal": broadcast.getValueFromHash('segment') }); - + $('body').on('mouseup',function(e){ - if($(e.target).parents('.segment-element').length === 0 && !$(e.target).is('.segment-element') && $(e.target).hasClass("ui-corner-all") == false + if($(e.target).parents('.segment-element').length === 0 && !$(e.target).is('.segment-element') && $(e.target).hasClass("ui-corner-all") == false && $(e.target).hasClass("ddmetric") == false && $(".segment-element:visible").length == 1 ) { $(".segment-element:visible").unbind().remove(); $("#segmentList").show(); } - + if($(e.target).parents('.segmentList').length === 0 && $(".segmentationContainer").hasClass("visible")){ - - $(".segmentationContainer").trigger("click"); + + $(".segmentationContainer").trigger("click"); } - + }); });
\ No newline at end of file diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index 1a55fbfc22..4d32b283f3 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -206,7 +206,7 @@ function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrenc } ); - var alreadyEdited = new Array; + var alreadyEdited = []; $('.editSite') .click(function () { piwikHelper.hideAjaxError(); @@ -274,7 +274,7 @@ function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrenc $(n).html(contentAfter); } else if (idName == 'ecommerce') { - ecommerceActive = contentBefore.indexOf("ecommerceActive") > 0 ? 1 : 0; + var ecommerceActive = contentBefore.indexOf("ecommerceActive") > 0 ? 1 : 0; contentAfter = getEcommerceSelector(ecommerceActive) + '<br />' + ecommerceHelp; $(n).html(contentAfter); } @@ -307,19 +307,19 @@ function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrenc var globalKeywordParameters = $('input#globalSearchKeywordParameters').val().trim(); var globalCategoryParameters = $('input#globalSearchCategoryParameters').val().trim(); if (contentBefore) { - enabled = contentBefore.indexOf("sitesearchActive") > 0 ? 1 : 0; - spanSearch = $(contentBefore).filter('.sskp'); + var enabled = contentBefore.indexOf("sitesearchActive") > 0 ? 1 : 0; + var spanSearch = $(contentBefore).filter('.sskp'); var searchKeywordParameters = spanSearch.attr('sitesearch_keyword_parameters').trim(); var searchCategoryParameters = spanSearch.attr('sitesearch_category_parameters').trim(); - checked = globalKeywordParameters.length && !searchKeywordParameters.trim().length; + var checked = globalKeywordParameters.length && !searchKeywordParameters.trim().length; } else { var searchKeywordParameters = globalKeywordParameters; var searchCategoryParameters = globalCategoryParameters; - enabled = searchKeywordParameters.length || searchCategoryParameters.length; // default is enabled - checked = enabled; + var enabled = searchKeywordParameters.length || searchCategoryParameters.length; // default is enabled + var checked = enabled; } - searchGlobalHasValues = globalKeywordParameters.trim().length; + var searchGlobalHasValues = globalKeywordParameters.trim().length; var html = '<select id="sitesearch" onchange="return onClickSiteSearchUseDefault();">'; var selected = ' selected="selected" '; html += '<option ' + (enabled ? selected : '') + ' value="1">' + sitesearchEnabled + '</option>'; @@ -328,7 +328,7 @@ function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrenc html += '<span style="font-size: 11px;"><br/>'; if (searchGlobalHasValues) { - checkedStr = checked ? ' checked ' : ''; + var checkedStr = checked ? ' checked ' : ''; html += '<label><span id="sitesearchUseDefault"' + (!enabled ? ' style="display:none" ' : '') + '><input type="checkbox" ' + checkedStr + ' id="sitesearchUseDefaultCheck" onclick="return onClickSiteSearchUseDefault();"> ' + sitesearchUseDefault + ' </span>'; html += '</label>'; @@ -354,7 +354,7 @@ function SitesManager(_timezones, _currencies, _defaultTimezone, _defaultCurrenc function getEcommerceSelector(enabled) { var html = '<select id="ecommerce">'; - selected = ' selected="selected" '; + var selected = ' selected="selected" '; html += '<option ' + (enabled ? '' : selected) + ' value="0">' + ecommerceDisabled + '</option>'; html += '<option ' + (enabled ? selected : '') + ' value="1">' + ecommerceEnabled + '</option>'; html += '</select>'; diff --git a/plugins/Transitions/templates/transitions.js b/plugins/Transitions/templates/transitions.js index b758612032..dec4442413 100644 --- a/plugins/Transitions/templates/transitions.js +++ b/plugins/Transitions/templates/transitions.js @@ -800,6 +800,9 @@ Piwik_Transitions_Canvas.prototype.isNarrowMode = function () { /** * Helper to create horizontal gradients + * + * @param lightColor + * @param darkColor * @param position left|right */ Piwik_Transitions_Canvas.prototype.createHorizontalGradient = function (lightColor, darkColor, position) { diff --git a/plugins/UsersManager/templates/UsersManager.js b/plugins/UsersManager/templates/UsersManager.js index 6d380bd3a7..0db663d7c2 100644 --- a/plugins/UsersManager/templates/UsersManager.js +++ b/plugins/UsersManager/templates/UsersManager.js @@ -147,7 +147,7 @@ function bindUpdateAccess() { } $(document).ready(function () { - var alreadyEdited = new Array; + var alreadyEdited = []; // when click on edituser, the cells become editable $('.edituser') .click(function () { diff --git a/plugins/Widgetize/templates/widgetize.js b/plugins/Widgetize/templates/widgetize.js index e54210642f..fb65dc7d02 100644 --- a/plugins/Widgetize/templates/widgetize.js +++ b/plugins/Widgetize/templates/widgetize.js @@ -13,7 +13,7 @@ function widgetize() { } this.getEmbedUrl = function (parameters, exportFormat) { - copyParameters = {}; + var copyParameters = {}; for (var variableName in parameters) { copyParameters[variableName] = parameters[variableName]; } @@ -38,9 +38,8 @@ function widgetize() { } this.callbackAddExportButtonsUnderWidget = function (widgetUniqueId, loadedWidgetElement) { - widget = widgetsHelper.getWidgetObjectFromUniqueId(widgetUniqueId); - widgetName = widget["name"]; - widgetParameters = widget['parameters']; + var widget = widgetsHelper.getWidgetObjectFromUniqueId(widgetUniqueId); + var widgetParameters = widget['parameters']; var exportButtonsElement = $('<span id="exportButtons">'); |