diff --git a/README.md b/README.md index 02483ae..aeabac7 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,15 @@ -# Symfony2 Profiler shortcut +# Symfony Profiler shortcut - -![Alt text](/ScreenShot/promo_1400.png "Symfony2 Profiler shortcut") - -Give access to Symfoy2 Profiler if any Response from a server is made with the "X-Debug-Token". Very useful for REST & AJAX Development/testing +Give access to Symfony Profiler if any Response from a server is made with the "X-Debug-Token". Very useful for REST & AJAX Development/testing # In details -This is an extension that help developer and/or tester to see relevant information on Symfony2 based applications. +This is an extension that help developer and/or tester to see relevant information on Symfony based applications. When you enable debug mode, you probably noticed a toolBar at the bottom. Very useful, clicking on it lead the the Profiler. The profiler make easy to access logs and many information about the current request. This extension is here to allow you to access easily to the Profiler event if the debug toolbar is disabled or not shown. -If you already made REST application with Symfony2 framework, you know that the Debug tool bar only show up if you render a real webPage. +If you already made REST application with Symfony framework, you know that the Debug tool bar only show up if you render a real webPage. If you render JSON or XML, you just have the result and to go to the Profiler is a long way. Actually, if you look at the Response headers, you'll notice a "X-Debug-Token:0b274e"; This is the key to go to the debugger. @@ -24,7 +21,7 @@ This extension can help you to open the profiler of AJAX/XHR request made on you ![Alt text](/ScreenShot/XHR.png "Multiple XHR calls") # OFFICIAL LINK -https://chrome.google.com/webstore/detail/symfony2-debuger/denlhphadllhcolhlbbbjmhkgbknmmon +https://chrome.google.com/webstore/detail/Symfony-debuger/denlhphadllhcolhlbbbjmhkgbknmmon ## Licencing @@ -32,4 +29,4 @@ This webapp/extension and all original files contained are under [Creative Commo Thanks for VisualPharm for some icons : http://www.visualpharm.com/ [Icon link](http://icons8.com/icons/#!/416/bug) -Thanks for Symfony2 and SensioLabs for SF icon : http://symfony.com/logo +Thanks for Symfony and SensioLabs for SF icon: http://symfony.com/logo diff --git a/ScreenShot/REST.tif b/ScreenShot/REST.tif deleted file mode 100644 index 9912dde..0000000 Binary files a/ScreenShot/REST.tif and /dev/null differ diff --git a/ScreenShot/promo_1400.png b/ScreenShot/promo_1400.png deleted file mode 100644 index 96fc686..0000000 Binary files a/ScreenShot/promo_1400.png and /dev/null differ diff --git a/ScreenShot/promo_1400.tif b/ScreenShot/promo_1400.tif deleted file mode 100644 index 7a2e8c4..0000000 Binary files a/ScreenShot/promo_1400.tif and /dev/null differ diff --git a/icon/minimalist_tardis_by_silveralchemistpony-d6dvtva.png b/icon/minimalist_tardis_by_silveralchemistpony-d6dvtva.png deleted file mode 100644 index a3a731c..0000000 Binary files a/icon/minimalist_tardis_by_silveralchemistpony-d6dvtva.png and /dev/null differ diff --git a/sf2Debugger/_locales/en/messages.json b/sf2Debugger/_locales/en/messages.json index 8daeaba..15bae79 100644 --- a/sf2Debugger/_locales/en/messages.json +++ b/sf2Debugger/_locales/en/messages.json @@ -1,11 +1,11 @@ { "appName": { - "message": "Symfony2 Profiler shortcut", - "description": "Easily open profiler from any symfony2 request that have the correct header" + "message": "Symfony Profiler shortcut", + "description": "Easily open profiler from any symfony request that have the correct header" }, "appDesc": { - "message": "Symfony2 Profiler shortcut", - "description": "Easily open debug toolBar and profiler from any symfony2 request that have the correct headerf \n Give access to Symfoy2 Profiler if any Response from a server is made with the \"X-Debug-Token\". Very useful for REST & AJAX Development/testing \n \n \n # In details \n This is an extension that help developer and/or tester to see relevant information on Symfony2 based applications. \n When you enable debug mode, you probably noticed a toolBar at the bottom. Very useful, clicking on it lead the the Profiler. \n The profiler make easy to access logs and many information about the current request. \n \n This extension is here to allow you to access easily to the fofiler event if the debug toolbar is disabled or not shown. \n If you already made REST application with Symfony2 framework, you know that the Debug tool bar only show up if you render a real webPage. \n If you render JSON or XML, you just have the result and to go to the Profiler is a long way." + "message": "Symfony Profiler shortcut", + "description": "Easily open debug toolBar and profiler from any Symfony request that have the correct headerf \n Give access to Symfoy2 Profiler if any Response from a server is made with the \"X-Debug-Token\". Very useful for REST & AJAX Development/testing \n \n \n # In details \n This is an extension that help developer and/or tester to see relevant information on Symfony based applications. \n When you enable debug mode, you probably noticed a toolBar at the bottom. Very useful, clicking on it lead the the Profiler. \n The profiler make easy to access logs and many information about the current request. \n \n This extension is here to allow you to access easily to the fofiler event if the debug toolbar is disabled or not shown. \n If you already made REST application with Symfony framework, you know that the Debug tool bar only show up if you render a real webPage. \n If you render JSON or XML, you just have the result and to go to the Profiler is a long way." }, "tokenDetected": { "message": "Token Detected", @@ -77,5 +77,4 @@ "option_form_help_memory": { "message" : " List all remembered choice made in the Url chooser.
Format : domainName|url (The url must contain only the token placeholder)

This field sync in cloud and shared between all your chrome instance." } - -} \ No newline at end of file +} diff --git a/sf2Debugger/_locales/fr/messages.json b/sf2Debugger/_locales/fr/messages.json index 2f7f936..d49c29d 100644 --- a/sf2Debugger/_locales/fr/messages.json +++ b/sf2Debugger/_locales/fr/messages.json @@ -1,11 +1,11 @@ { "appName": { - "message": "Symfony2 Profiler", + "message": "Symfony Profiler", "description": "Donne accès directement depuis la bare d'adresse au Syfony2Profiler" }, "appDesc": { - "message": "Accès rapide au profiler de Symfony2 , et permet l'accès au profiling des requêtes AJAX et sans body", - "description": "Vous permet d'accéder rapidement et facilement au Profiler de Symfony2 meme si la debugTool bar ne s'affiche pas. Le token present dans le header est utilisé directement. \n C'est souvent utile lors du development d'API REST ou de site web avec des requêtes AJAX/XHR" + "message": "Accès rapide au profiler de Symfony, et permet l'accès au profiling des requêtes AJAX et sans body", + "description": "Vous permet d'accéder rapidement et facilement au Profiler de Symfony meme si la debugTool bar ne s'affiche pas. Le token present dans le header est utilisé directement. \n C'est souvent utile lors du development d'API REST ou de site web avec des requêtes AJAX/XHR" }, "tokenDetected": { "message": "Token détécté", @@ -77,4 +77,4 @@ "option_form_help_memory": { "message" : "Liste des choix mémorisés dans le selecteur d'URL
Format : domainName|URL (L'URL doit contenir seulement le placeholder du token (*token*))

Cette liste est sycnhronisée dans le cloud et est partagée par toutes vos instances de Chrome" } -} \ No newline at end of file +} diff --git a/sf2Debugger/css/Charts-Mind-map-icon.png b/sf2Debugger/css/Charts-Mind-map-icon.png deleted file mode 100644 index 33edac2..0000000 Binary files a/sf2Debugger/css/Charts-Mind-map-icon.png and /dev/null differ diff --git a/sf2Debugger/css/tokenSelection.css b/sf2Debugger/css/tokenSelection.css index 957c707..d39efb5 100644 --- a/sf2Debugger/css/tokenSelection.css +++ b/sf2Debugger/css/tokenSelection.css @@ -6,7 +6,6 @@ body { } html{ - padding:0; } @@ -33,17 +32,12 @@ html{ .tokenListItem { list-style: none; margin: 0; - padding: 0; - padding-top: 3px; - padding-bottom:4px; - padding-left: 3px; + padding: 3px 0 4px 3px; border-radius: 2px; } .tokenListItem:hover { background-color: rgba(161, 227, 4, 0.5); - /*transition: 0.1s ease-in-out;*/ - /*background-color: #a1e304;*/ } .tokenUrl { @@ -133,13 +127,11 @@ html{ } .icon { - display: inline-block; height: 16px; width: 16px; background-repeat: no-repeat; background-position: center center; - /*border-radius: 2px;*/ line-height: 16px; background-size: 100% 100%; } @@ -148,7 +140,6 @@ html{ cursor: pointer; background-color: rgba(161, 227, 4, 0.2); transition: 0.1s ease-in-out; - } .icon.icon_config { @@ -202,10 +193,7 @@ html{ background-color: rgba(0, 255, 0, 0.2); border: 2px solid transparent; border-radius: 5px; - padding-left: 2px; - padding-right: 2px; - padding-top: 1px; - padding-bottom: 1px; + padding: 1px 2px; font-size: 70%; display: block; height: 10px; @@ -239,10 +227,7 @@ html{ padding:0; } .pure-button a{ - padding-left:5px; - padding-right:2px; - padding-top:2px; - padding-bottom:3px; + padding: 2px 2px 3px 5px; color: white; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); text-decoration: none; @@ -255,4 +240,4 @@ html{ } .pure-button a:last-of-type{ padding-left:2px; -} \ No newline at end of file +} diff --git a/sf2Debugger/js/configuration.js b/sf2Debugger/js/configuration.js index bcea60c..c41b125 100644 --- a/sf2Debugger/js/configuration.js +++ b/sf2Debugger/js/configuration.js @@ -1,6 +1,46 @@ (function () { - var defaultValues = [ + const callConfigurationReload = function () { + chrome.extension.sendRequest( + { + method: "reloadConfiguration", + data: {} + } + ); + }; + /** + * Store data into Configuration + * @param data + * @param callback + */ + const storeConfiguration = function (data, callback) { + if (data == null) { + chrome.storage.sync.remove('configuration', function () { + callConfigurationReload.apply(this); + callback.apply(this); + }) + } else { + chrome.storage.sync.set({'configuration': data}, function () { + callConfigurationReload.apply(this); + callback.apply(this); + }); + } + + }; + /** + * Retrieve all configuration data saved in chrome storage + * @param callback + */ + const getConfiguration = function (callback) { + chrome.storage.sync.get('configuration', function (data) { + if (typeof data.configuration !== 'undefined') { + callback.apply(this, [data.configuration]); + } else { + callback.apply(this, []); + } + }); + }; + const defaultValues = [ { name: 'headerName', value: 'X-Debug-Token' @@ -28,8 +68,7 @@ { name: 'profilerUrlTemplate', value: - '#domain#/app.php/_profiler/*token*'+"\n"+ - '#domain#/app_dev.php/_profiler/*token*'+"\n"+ + '#domain#/index.php/_profiler/*token*' + "\n" + '#domain#/_profiler/*token*' }, @@ -41,30 +80,30 @@ ]; + const startup = function () { + getConfiguration(function (configurations) { + if (typeof configurations !== 'undefined' && configurations.length <= 0) { - var startup = function () { - getConfiguration(function (configurations) { - if (typeof configurations !== 'undefined' && configurations.length <= 0) { - - } else if (typeof configurations == 'undefined') { - storeConfiguration({}, function () { - chrome.tabs.create({'url': 'options.html'}); - }); - } - }); + } else if (typeof configurations == 'undefined') { + storeConfiguration({}, function () { + chrome.tabs.create({'url': 'options.html'}); + }); + } + }); }; - var getDefaultValue = function (key) { - var to = null; + const getDefaultValue = function (key) { + let to = null; _.each(defaultValues, function (item) { if (item.name == key) { to = item.value; } }); + return to; }; - var getDefaultConfiguration = function(){ - return defaultValues ; + const getDefaultConfiguration = function () { + return defaultValues; }; @@ -73,13 +112,13 @@ * @param keyName * @param callback */ - var getConfigurationKey = function (keyName, callback) { + const getConfigurationKey = function (keyName, callback) { getConfiguration(function (configurations) { - var br = false ; + let br = false; if (configurations && configurations.length >= 1) { _.each(configurations, function (item) { - if(br === true){ - return ; // do not call callback twice + if (br === true) { + return; // do not call callback twice } if (item.name == keyName) { callback.apply(this, [item.value]); @@ -87,70 +126,26 @@ } }); } - if(br === false){ - callback.apply(this,[getDefaultValue(keyName)]); + if (br === false) { + callback.apply(this, [getDefaultValue(keyName)]); } }) }; - var extractConfiguration = function(keyName,config){ - var result = null ; + const extractConfiguration = function (keyName, config) { + let result = null; _.each(config, function (item) { if (item.name == keyName) { - result = item.value ; - return result ; - } - }); - if(result == null){ - result = getDefaultValue(keyName) - } - return result ; - }; + result = item.value; - /** - * Retrieve all configuration data saved in chrome storage - * @param callback - */ - var getConfiguration = function (callback) { - chrome.storage.sync.get('configuration', function (data) { - if (typeof data.configuration !== 'undefined') { - callback.apply(this, [data.configuration]); - } else { - callback.apply(this, []); + return result; } }); - }; - - - /** - * Store data into Configuration - * @param data - * @param callback - */ - var storeConfiguration = function (data, callback) { - if(data == null){ - chrome.storage.sync.remove('configuration',function(){ - callConfigurationReload.apply(this); - callback.apply(this); - }) - }else{ - chrome.storage.sync.set({'configuration': data}, function () { - callConfigurationReload.apply(this); - callback.apply(this); - }); + if (result == null) { + return getDefaultValue(keyName) } - - }; - - - var callConfigurationReload = function(){ - chrome.extension.sendRequest( - { - method: "reloadConfiguration", - data : {} - } - ); + return result; }; @@ -160,22 +155,22 @@ * @param data * @param callback */ - var storeConfigurationKey = function(key,data,callback){ - getConfiguration(function(config){ - var done = false ; - _.each(config,function(item,indice){ - if(item.name == key){ - config[indice].value = data ; - done = true ; + const storeConfigurationKey = function (key, data, callback) { + getConfiguration(function (config) { + var done = false; + _.each(config, function (item, indice) { + if (item.name == key) { + config[indice].value = data; + done = true; } }); - if(done == false){ + if (done == false) { config.push({ - name : key, - value:data + name: key, + value: data }); } - storeConfiguration(config,callback); + storeConfiguration(config, callback); }) }; @@ -186,8 +181,8 @@ window.storeConfiguration = storeConfiguration; window.storeConfigurationKey = storeConfigurationKey; - window.extractConfiguration = extractConfiguration ; + window.extractConfiguration = extractConfiguration; startup(); -})(); \ No newline at end of file +})(); diff --git a/sf2Debugger/js/openToken.js b/sf2Debugger/js/openToken.js index 60fcd05..447d630 100644 --- a/sf2Debugger/js/openToken.js +++ b/sf2Debugger/js/openToken.js @@ -1,49 +1,37 @@ (function () { - - - var createProfilerLink = function (token,target,callback) { - var matches = token.url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); - var domain = matches && matches[1]; - var url = 'suchi.html#domain='+domain + '&token=' + token.value; - if(target == null){ + const createProfilerLink = function (token, target, callback) { + const matches = token.url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); + const domain = matches && matches[1]; + let url = 'suchi.html#domain=' + domain + '&token=' + token.value; + if (target == null) { window.getConfigurationKey('defaultPage', function (defaultPage) { - if(defaultPage !== null && defaultPage !== 'null'){ - url += '&panel='+defaultPage ; - }else{ - url += '&panel=' ; + if (defaultPage !== null && defaultPage !== 'null') { + url += '&panel=' + defaultPage; + } else { + url += '&panel='; } - callback.apply(this,[url]); + callback.apply(this, [url]); }); - }else{ - url += '?panel='+target ; - callback.apply(this,[url]); - } - }; + return; + } + url += '?panel=' + target; + callback.apply(this, [url]); + }; - /** - * Open a new popup/tab with the profiler in it - * @param token - */ - var openToken = function (token,target) { - if(typeof target == 'undefined'){ - target = null ; + window.openToken = (token, target) => { + if (typeof target == 'undefined') { + target = null; } - createProfilerLink(token,target,function(url){ + createProfilerLink(token, target, function (url) { window.getConfigurationKey('profilerDestination', function (profilerDestination) { if (token.popup === true || profilerDestination == 'popup') { chrome.windows.create({'url': url, 'type': 'popup'}); } else { chrome.tabs.create({'url': url}); } - }); }); - }; - - - window.openToken = openToken; - -})(); \ No newline at end of file +})(); diff --git a/sf2Debugger/js/options.js b/sf2Debugger/js/options.js index fe8f96e..0de21ae 100644 --- a/sf2Debugger/js/options.js +++ b/sf2Debugger/js/options.js @@ -1,53 +1,84 @@ (function () { + const unCleanDataForForm = function (data) { + if (data == null) { + return 'null'; + } + if (data == true) { + return 'true'; + } + if (data === false) { + return 'false'; + } + if (_.isArray(data)) { + return data.join('\n'); + } + return data; + }; /** - * startup the page + * Parse form fields to retrieve an array of objects {name/value} + * @param form (jquery form) + * @returns {Array} */ - var startup = function () { - var form = $('form[name=options]').first(); - disableForm(form); //block any user interaction - initForm(form,window.getDefaultConfiguration()); - window.getConfiguration(function (config) { - initForm(form, config); - enableForm(form); //re-enable all userInteraction - form.on('submit', function (event) { - event.stopPropagation(); - submitForm(form); //Do main job (saving configuration) - return false; - }) - }); + const getDataFromForm = function (form) { + enableForm(form); + var data = form.serializeArray(); + disableForm(form); + /*var fields = string.split("&"); + + var data = []; + _.each(fields, function (item) { + var split = item.split('='); + data.push({ + name: split[0], + value: cleanFormData(split[1]) + }); + });*/ + return data; + }; + /** + * Enable all field into the form + * @param form + */ + const enableForm = function (form) { + form.find(':input').prop("disabled", false); //enable all field (input,textArea, select ...) + }; + /** + * disable all form field into the form to avoid any modification or submit + * @param form + */ + const disableForm = function (form) { + form.find(':input').prop("disabled", true); //disable all field (input,textArea, select ...) }; - - /** * init a form with data passed in argument * @param form a jQuery form element * @param {Array} */ - var initForm = function (form, data) { + const initForm = function (form, data) { _.each(data, function (item) { var formValue = unCleanDataForForm(item.value); console.debug('Setting form field ' + item.name + ' with value:' + formValue); form.find('*[name=' + item.name + ']').val(formValue); }); }; - - /** - * Enable all field into the form - * @param form - */ - var enableForm = function (form) { - form.find(':input').prop("disabled", false); //enable all field (input,textArea, select ...) - }; - - /** - * disable all form field into the form to avoid any modification or submit - * @param form + * startup the page */ - var disableForm = function (form) { - form.find(':input').prop("disabled", true); //disable all field (input,textArea, select ...) + const startup = function () { + var form = $('form[name=options]').first(); + disableForm(form); //block any user interaction + initForm(form, window.getDefaultConfiguration()); + window.getConfiguration(function (config) { + initForm(form, config); + enableForm(form); //re-enable all userInteraction + form.on('submit', function (event) { + event.stopPropagation(); + submitForm(form); //Do main job (saving configuration) + return false; + }) + }); }; @@ -72,35 +103,13 @@ }); }; - /** - * Parse form fields to retrieve an array of objects {name/value} - * @param form (jquery form) - * @returns {Array} - */ - var getDataFromForm = function (form) { - enableForm(form); - var data = form.serializeArray(); - disableForm(form); - /*var fields = string.split("&"); - - var data = []; - _.each(fields, function (item) { - var split = item.split('='); - data.push({ - name: split[0], - value: cleanFormData(split[1]) - }); - });*/ - return data; - }; - /** * Transform some data into there primitives (true,false,null ...) * @param data * @returns {*} */ - var cleanFormData = function (data) { + const cleanFormData = function (data) { if (data === 'null') { return null; } @@ -110,32 +119,12 @@ if (data == 'false') { return false; } - if (data == ''){ - return ' ' ; + if (data == '') { + return ' '; } - return data ; - }; - - var unCleanDataForForm = function(data){ - if (data == null) { - return 'null'; - } - if (data == true) { - return 'true'; - } - if (data === false) { - return 'false'; - } - if(_.isArray(data)){ - return data.join('\n'); - } - - - - return data ; + return data; }; - startup(); -})(); \ No newline at end of file +})(); diff --git a/sf2Debugger/js/suchi.js b/sf2Debugger/js/suchi.js index 05e648b..2d8928b 100644 --- a/sf2Debugger/js/suchi.js +++ b/sf2Debugger/js/suchi.js @@ -1,119 +1,112 @@ (function(){ - var listToTry = [] ; + /** + * Load URL and put hte page into loading mode + * @param url + */ + const go = function(url){ + console.debug('GO : '+url); + $('body').addClass('isloading'); + window.location = url ; + }; + const addMemory = function(domain, uri, callback){ + console.debug('remember : '+domain+ ' '+uri); + memory[domain] = uri ; + var textMemory = []; + console.dir(memory); + _.each(memory,function(item,key){ + textMemory.push(key+'|'+item); + }); + textMemory = textMemory.join("\n"); + + window.storeConfigurationKey('profilerUrlTemplateMemory',textMemory,callback); + }; + const checkMemory = function(domain, token, panel){ + _.each(memory,function(item,key){ + if(key == domain){ + go(generateUrl(item,token,panel)); + } + }); + }; + const generateUrl = function (uri, token, panel){ + uri = uri.replace('*token*',token); + console.dir(panel); + if(panel !== ''){ + uri +='?panel='+panel + } + return uri ; + }; + const submitForm = function(e){ + var d = $('#urlFormChooser').serializeArray(); + var data = {} ; + _.each(d,function(item){ + data[item.name] = item.value ; + }); + e.preventDefault(); + if(typeof data.remember !== 'undefined'){ + addMemory(data.domain,data.scheme+data.uri,function(){ + go(generateUrl(data.scheme+data.uri,data.token,data.panel)); + }); + }else{ + go(generateUrl(data.scheme+data.uri,data.token,data.panel)); + } + }; + let listToTry = []; var memory = {}; - var startup = function(){ + const startup = function () { console.dir(memory); console.dir(listToTry); var anchor = window.location.hash; - var list = anchor.replace('#','').split('&'); + var list = anchor.replace('#', '').split('&'); var queryString = {}; - _.each(list,function(item){ - var s = item.split('='); - queryString[s[0]] = s[1] ; + _.each(list, function (item) { + var s = item.split('='); + queryString[s[0]] = s[1]; }); - checkMemory(queryString.domain,queryString.token,queryString.panel); + checkMemory(queryString.domain, queryString.token, queryString.panel); var listToDisplay = []; - _.each(listToTry,function(item){ - var url = item ; - _.each(queryString,function(qsItem,qsKey){ - url = url.replace('#'+qsKey+'#',qsItem); + _.each(listToTry, function (item) { + var url = item; + _.each(queryString, function (qsItem, qsKey) { + url = url.replace('#' + qsKey + '#', qsItem); }); listToDisplay.push(url); }); - var optionsStirng = '' ; - _.each(listToDisplay,function(item){ - optionsStirng += '
  • ' ; + var optionsStirng = ''; + _.each(listToDisplay, function (item) { + optionsStirng += '
  • '; }); $('#urlChooserList').html(optionsStirng); $('#token').val(queryString.token); $('#domain').val(queryString.domain); - $('input.submit').on('change',submitForm); + $('input.submit').on('change', submitForm); - $('#urlFormChooser').on('submit',submitForm); + $('#urlFormChooser').on('submit', submitForm); - $('.schemeSelector input').on('change',function(){ - if($(this).val() !== 'https://'){ + $('.schemeSelector input').on('change', function () { + if ($(this).val() !== 'https://') { $('.shemeSansS').addClass('selected'); $('.shemeAvecS').removeClass('selected'); - }else{ + } else { $('.shemeSansS').removeClass('selected'); $('.shemeAvecS').addClass('selected'); } }); $('.schemeSelector input:checked').trigger('change'); - $('.add').on('click',function(){ + $('.add').on('click', function () { go('options.html'); }); }; - var submitForm = function(e){ - var d = $('#urlFormChooser').serializeArray(); - var data = {} ; - _.each(d,function(item){ - data[item.name] = item.value ; - }); - e.preventDefault(); - if(typeof data.remember !== 'undefined'){ - addMemory(data.domain,data.scheme+data.uri,function(){ - go(generateUrl(data.scheme+data.uri,data.token,data.panel)); - }); - }else{ - go(generateUrl(data.scheme+data.uri,data.token,data.panel)); - } - }; - - - var checkMemory = function(domain,token,panel){ - _.each(memory,function(item,key){ - if(key == domain){ - go(generateUrl(item,token,panel)); - } - }); - }; - - var generateUrl = function (uri,token,panel){ - uri = uri.replace('*token*',token); - console.dir(panel); - if(panel !== ''){ - uri +='?panel='+panel - } - return uri ; - }; - - var addMemory = function(domain,uri,callback){ - console.debug('remember : '+domain+ ' '+uri); - memory[domain] = uri ; - var textMemory = []; - console.dir(memory); - _.each(memory,function(item,key){ - textMemory.push(key+'|'+item); - }); - textMemory = textMemory.join("\n"); - - window.storeConfigurationKey('profilerUrlTemplateMemory',textMemory,callback); - }; - - - /** - * Load URL and put hte page into loading mode - * @param url - */ - var go = function(url){ - console.debug('GO : '+url); - $('body').addClass('isloading'); - window.location = url ; - }; - //Starter window.getConfigurationKey('profilerUrlTemplate',function(profilerUrlTemplate){ @@ -130,4 +123,4 @@ }); }); -})(); \ No newline at end of file +})(); diff --git a/sf2Debugger/js/tokenSelection.js b/sf2Debugger/js/tokenSelection.js index 172001b..b4411ea 100644 --- a/sf2Debugger/js/tokenSelection.js +++ b/sf2Debugger/js/tokenSelection.js @@ -20,13 +20,13 @@ }); } - var templates = { - tokenList : _.template('
    ' + - ''+chrome.i18n.getMessage('tokenDetected')+' : {{tokenCount}} ' + + const templates = { + tokenList: _.template('
    ' + + '' + chrome.i18n.getMessage('tokenDetected') + ' : {{tokenCount}} ' + ' ' + ' ' + '
    '), - tokenListItem : _.template('' + + tokenListItem: _.template('' + '
  • ' + ' {{ url }}' + ' {{status}}' + @@ -219,4 +219,4 @@ bind_events(); }); -})(); \ No newline at end of file +})(); diff --git a/sf2Debugger/manifest.json b/sf2Debugger/manifest.json index 221dad8..8ffe8f5 100644 --- a/sf2Debugger/manifest.json +++ b/sf2Debugger/manifest.json @@ -17,7 +17,7 @@ "19": "icon32.png", "38": "icon64.png" }, - "default_title": "Symfony2 Debuger", + "default_title": "Symfony Debugger", "popup": "popup.html" }, "content_security_policy": "script-src 'self' https://ssl.google-analytics.com 'unsafe-eval' ; img-src http://www.google-analytics.com; script-src 'self' 'unsafe-eval' ; script-src 'self' 'unsafe-inline'; object-src 'self'; ", @@ -25,4 +25,4 @@ "permissions": [ "storage", "webRequest", "tabs", "" ] -} \ No newline at end of file +} diff --git a/sf2Debugger/options.html b/sf2Debugger/options.html index 74341e5..7a00cd4 100644 --- a/sf2Debugger/options.html +++ b/sf2Debugger/options.html @@ -3,7 +3,7 @@ - SF2 profiler + SF profiler @@ -12,7 +12,6 @@ - @@ -32,7 +31,7 @@

    Symfony profiler shortcut

    -
    +
    Configuration
    @@ -91,9 +90,8 @@

    Symfony profiler shortcut

    - -
    @@ -122,4 +120,4 @@

    Symfony profiler shortcut

    - \ No newline at end of file + diff --git a/sf2Debugger/suchi.html b/sf2Debugger/suchi.html index cfd6385..a5d5e9a 100644 --- a/sf2Debugger/suchi.html +++ b/sf2Debugger/suchi.html @@ -3,7 +3,7 @@ - SF2 profiler + SF profiler @@ -61,4 +61,4 @@

    Choose a profiler url

    - \ No newline at end of file + diff --git a/sf2Debugger/tokenSelection.html b/sf2Debugger/tokenSelection.html index 2fd6774..e4e357d 100644 --- a/sf2Debugger/tokenSelection.html +++ b/sf2Debugger/tokenSelection.html @@ -22,7 +22,7 @@ @@ -40,11 +39,11 @@
    - Symfony profiler shortcut + Symfony profiler shortcut
    - \ No newline at end of file + diff --git a/sf2Debugger/views/popup.html b/sf2Debugger/views/popup.html deleted file mode 100644 index 8b13789..0000000 --- a/sf2Debugger/views/popup.html +++ /dev/null @@ -1 +0,0 @@ -