1. ryanackley
  2. tincr

Commits

ryanackley  committed 0de3fd7

working config screen for tincr

  • Participants
  • Parent commits fc60371
  • Branches master

Comments (0)

Files changed (21)

File AtlassianPluginProject.js

View file
  • Ignore whitespace
 	mapDataToUrl : function(url, obj){
 		ProjectUtils.cacheRelationship(url, obj, true, this.cachedUrlMap, this.matchedFileMap);
 	},
+	clearUrlCache : function(url){
+		ProjectUtils.clearUrlCache(url, true, this.cachedUrlMap, this.matchedFileMap);
+	},
 	resetUrls : function(){
 		this.matchedFileMap = {};
 		this.cachedUrlMap = {};

File BackgroundMsgSupport.js

View file
  • Ignore whitespace
 	pageChanged : function(callback){
 		chrome.extension.sendRequest({key: 'pageChanged'}, callback);
 	},
-	
 	unwatchDirectory : function(callback){
 		chrome.extension.sendRequest({key: 'unwatchDirectory'}, callback); 
 	},
 	loadProject : function(type, path, url, urlPathMap, callback){
 		chrome.extension.sendRequest({key: 'loadProject', type: type, path: path, url: url, urlPathMap: urlPathMap}, callback);
+	},
+	setResourceOptions : function(url, exactMatch, callback){
+		chrome.extension.sendRequest({key: 'setResourceOptions', url: url, exactMatch: exactMatch}, callback);
+	},
+	removeDependency : function(url, index, callback){
+		chrome.extension.sendRequest({key: 'removeDependency', url: url, index: index}, callback);
+	},
+	setCustomPathData : function(url, data, callback){
+		chrome.extension.sendRequest({key: 'setCustomPathData', url:url, data: data}, callback);
 	}
 }

File ChromeExtensionProject.js

View file
  • Ignore whitespace
 	mapDataToUrl : function(url, obj){
 		ProjectUtils.cacheRelationship(url, obj, true, this.cachedUrlMap, this.projectUrls);
 	},
+	clearUrlCache : function(url){
+		ProjectUtils.clearUrlCache(url, true, this.cachedUrlMap, this.projectUrls);
+	},
 	resetUrls : function(){
 		this.projectUrls = {};
 		this.cachedUrlMap = {};

File ConfigFileBasedProject.js

View file
  • Ignore whitespace
 	mapDataToUrl : function(url, data){
 		// do nothing , the project type doesn't support customization
 	},
+	clearUrlCache : function(url){
+		// do nothing
+	},
 	resetUrls : function(){
 		this.projectUrls = {};
 		this.cachedUrlMap = {};

File FileUrlProject.js

View file
  • Ignore whitespace
 	mapDataToUrl : function(){
 		//do nothing. this function is for allowing custom mappings but it's not supported for this project type
 	},
+	clearUrlCache : function(url){
+		// do nothing
+	},
 	resetUrls : function(){
 		this.projectUrls = {};
 	}

File FileWatcher.js

View file
  • Ignore whitespace
 		}
 		var urls = this.project.urlsForFilePath(path);
 		if (urls && urls.length){
-			// check if we should do any sass, less, etc. rendering here
-			var preProcess = this.project.preProcessForFilePath(path);
-			if (preProcess != null){
-				preProcess(path);
-			}
+			// // check if we should do any sass, less, etc. rendering here
+			// var preProcess = this.project.preProcessForFilePath(path);
+			// if (preProcess != null){
+			// 	preProcess(path);
+			// }
 			//var port = chrome.tabs.connect(this.tabId, {name: 'fileChange'});
 			var ran = Math.round(Math.random()*10000000);
 			var self = this;

File ProjectManager.js

View file
  • Ignore whitespace
 
 	launchFileSelect : function(tabId, url, op, sendResponse){
 		var currentProject = this.projectsByTab[tabId];
+		var self = this;
 		if (currentProject){
 			nativeFileSupport.launchFileSelect(function(path){
 				if (path && path.length){
 					if (op == 'autosave'){
 						var data = {autoSave: path};
-						currentProject.mapDataToUrl(url, data);
-						sendResponse(data);
+						self._setPathData(currentProject, url, data, sendResponse);
 					}
 					else if (op == 'add-autorefresh'){
 						var data = currentProject.filePathsForUrl(url);
 						if (data.autoSave){
 							delete data.autoSave;
 						}
+
 						data.autoReload = data.autoReload || [];
+						for (var i = 0; i < data.autoReload.length; i++){
+							if (data.autoReload[i] == path){
+								sendResponse(data);
+								return;
+							}
+						}
 						data.autoReload.push(path);
-						currentProject.mapDataToUrl(url, data);
-						sendResponse(data);
+						self._setPathData(currentProject, url, data, sendResponse);
 					}
 				}
 			});
 		}
 	},
-
-	removeAutoRefresh : function(tabId, url, index, sendResponse){
+	setCustomPathData : function(tabId, url, data, sendResponse){
+		var currentProject = this.projectsByTab[tabId];
+		this._setPathData(currentProject, url, data, sendResponse);
+	},
+	_setPathData : function(currentProject, url, data, sendResponse){
+		currentProject.clearUrlCache(url);
+		currentProject.mapDataToUrl(url, data);
+		sendResponse(data);
+	},
+	setResourceOptions : function(tabId, url, exactMatch, sendResponse){
+		var currentProject = this.projectsByTab[tabId];
+		var data = currentProject.filePathsForUrl(url);
+		if (exactMatch){
+			if (data.autoReload && data.autoReload.length >= 1){
+				data.autoSave = data.autoReload[0];
+				var dependencies = data.autoReload.slice(1);
+				if (dependencies && dependencies.length){
+					data.old = data.old || {};
+					data.old.dependencies = dependencies;
+				}
+				delete data.autoReload;
+			}
+		}
+		else {
+			if (data.autoSave){
+				data.autoReload = data.autoReload || [];
+				data.autoReload[0] = data.autoSave;
+				if (data.old && data.old.dependencies){
+					data.autoReload = data.autoReload.concat(data.old.dependencies);
+				}
+				delete data.autoSave;
+			}
+		}
+		this._setPathData(currentProject, url, data, sendResponse);
+	},
+	removeDependency : function(tabId, url, index, sendResponse){
 		var currentProject = this.projectsByTab[tabId];
 		var data = currentProject.filePathsForUrl(url);
-		var index = opData.index;
 		data.autoReload = data.autoReload || [];
 		if (data.autoReload[index]){
 			data.autoReload.splice(index, 1);
 				if (urls[i].type == 'script' || urls[i].type == 'stylesheet'){
 					var url = urls[i].url;
 				    var obj = currentProject.filePathsForUrl(url);
-				    retVal.push(obj);
+				    if (obj && (obj.autoSave || obj.autoReload)){
+				    	retVal.push(obj);
+				    }
+				    else{
+				    	retVal.push(null);
+				    }
 				}
 				else{
 					retVal.push(null);
 					}
 				}, function(){});
 			}
+			else{
+				sendResponse({success: false, msg: 'Can\'t find path for url ' + url});
+			}
+		}
+		else{
+			sendResponse({success: false, msg: 'Can\'t find a current project for the tab'});
 		}
 	},
 	
 		var watcher = this.watchersByTab[tabId];
 		//currentProject.commitResource(url, content, currentWatcher, sendResponse);
 		var obj = currentProject.filePathsForUrl(url);
-		var localPath = obj.autoSaveP;
+		var localPath = obj.autoSave;
 		if (localPath){
 			watcher.addChangedByMe(localPath);
 			Gito.FileUtils.mkfile(this.fsRoot, localPath, content, sendResponse);

File ProjectUtils.js

View file
  • Ignore whitespace
+var ProjectUtils = {
+    scanDirectory : function(root, path, onFile, onEnd){
+
+        var walkTree = function(dir, callback){
+            Gito.FileUtils.ls(dir, function(entries){
+                entries.asyncEach(function(entry, done){
+                    if (entry.isFile){
+                        onFile(entry);
+                        done();
+                    }
+                    else{
+                        walkTree(entry, done);
+                    }
+                }, callback);
+            });
+        }
+        if (path){
+            root.getDirectory(path, {create:false}, function(dir){
+                walkTree(dir, onEnd);
+            }, onEnd);
+        }
+        else
+        {
+            walkTree(root, onEnd);
+        }
+    },
+    stripQueryString : function(rawUrl){
+        var url = rawUrl.split("?")[0];
+        return url;
+    },
+    clearUrlCache : function(rawUrl, stripQuery, urlCache, fileCache){
+        var url = stripQuery ? ProjectUtils.stripQueryString(rawUrl) : rawUrl;
+        var data = urlCache[url];
+        if (data && data.autoReload){
+            for (var i = 0; i < data.autoReload.length; i++){
+                delete fileCache[data.autoReload[i]];
+            }
+        }
+    },
+    cacheRelationship : function(rawUrl, obj, stripQuery, urlCache, fileCache){
+        url = stripQuery ? ProjectUtils.stripQueryString(rawUrl) : rawUrl;
+        urlCache[url] = obj;
+        if (obj.autoSave){
+            fileCache[obj.autoSave] = rawUrl;
+        }
+        else if (obj.autoReload){
+            for (var i = 0; i < obj.autoReload.length; i++){
+                fileCache[obj.autoReload[i]] = rawUrl;
+            }
+        }
+    }  
+};

File ResourceChecker.js

View file
  • Ignore whitespace
 var recentUpdateHandler = new RecentUpdateHandler(500);
 
 var matchResourcesWithProject = function(resources){
-	var confirmResourceContent = function(resource){
+	var confirmResourceContent = function(resource, paths){
 		resource.getContent(function(content){
 			backgroundMsgSupport.checkResourceContent(resource.url, content, function(data){
 				if (data.success){
 					if (data.content){
 						doResourceUpdate(resource, data.content);
 					}
+					resource.paths = paths;
 					$(window).trigger('resourceConfirm', [resource]);
 				}
 				else{
 	
 	backgroundMsgSupport.checkResources(resources, function(data){
 		for (var i = 0; i < data.length; i++){
-			if (projectState.urlPathMap[resources[i].url]){
-				resources[i].paths = projectState.urlPathMap[resources[i].url];
-				$(window).trigger('resourceConfirm', [resource, true]);
+			if (projectState.urlDataMap[resources[i].url]){
+				var pathData = projectState.urlDataMap[resources[i].url];
+				//resources[i].paths = projectState.urlDataMap[resources[i].url];
+				var setCustomPathData = function(resource, pathData){
+					backgroundMsgSupport.setCustomPathData(resource.url, pathData, function(data){
+						resource.paths = data;
+						$(window).trigger('resourceConfirm', [resource, true]);
+					});
+				}
+				setCustomPathData(resources[i], pathData);
+				
 			}
 			else if (data[i]){
-				confirmResourceContent(resources[i]);
-				resources[i].paths = data[i];
+				if (data[i].autoSave){
+					confirmResourceContent(resources[i], data[i]);
+				}
+				else{
+					resources[i].paths = data[i];
+					$(window).trigger('resourceConfirm', [resources[i], true]);
+				}
 			}
 		}
 	});
 }
 chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener(function(resource, content){
 	if (projectState.autosave && matchedUrls[resource.url] && !recentUpdateHandler.isRecentUpdate(resource.url)){
-		backgroundMsgSupport.updateResource(resource.url, content);
+		backgroundMsgSupport.updateResource(resource.url, content, function(){});
 	}
 });
 var doResourceUpdate = function(resource, newContent){
 	recentUpdateHandler.addRecentUpdate(resource.url);
-	resource.setContent(newContent, true);
-	logMessage('Auto-Reloaded ' + resource.url);
+	if (isFullReload(resource.url) || resource.type == 'document'){
+		chrome.devtools.inspectedWindow.reload({ignoreCache:true});
+	}
+	else{
+		resource.setContent(newContent, true, function(err){
+			if (err){
+				logError(err);
+			}
+			else{
+				logMessage('Auto-Reloaded ' + resource.url);
+			}
+		});
+	}
 };
 var fileChangeListener = function(data){
 	// resource content seems to be naively cached. No way to get the most recent content without

File RubyOnRailsProject.js

View file
  • Ignore whitespace
 	mapDataToUrl : function(url, obj){
 		ProjectUtils.cacheRelationship(url, obj, false, this.cachedUrlMap, this.matchedFileMap);
 	},
+	clearUrlCache : function(url){
+		ProjectUtils.clearUrlCache(url, false, this.cachedUrlMap, this.matchedFileMap);
+	},
 	resetUrls : function(){
 		this.cachedUrlMap = {};
 		this.matchedFileMap = {};

File background.html

View file
  • Ignore whitespace
     	<embed type="application/x-npapifileioforchrome" id="pluginId" style="position:absolute; top:0px;left:-10000px;width:5px;height:5px;">
         <script src="nativeSupport.js"></script>
         <script src="FauxFilesystem.js"></script>
-        <embed name="nacl_module"
+        <!--<embed name="nacl_module"
            id="ruby"
            width="0" height="0"
            src="sass/ruby.nmf"
            type="application/x-nacl" />
-        <script src="TincrSassSupport.js"></script>
+        <script src="TincrSassSupport.js"></script>-->
 		<script src="background.js"></script>
   </head>
   <body>

File background.js

View file
  • Ignore whitespace
     else if (request.key == 'unwatchDirectory'){
         projectManager.unwatchDirectory(sender.tab.id, sendResponse);
     }
+    else if (request.key == 'setResourceOptions'){
+        projectManager.setResourceOptions(sender.tab.id, request.url, request.exactMatch, sendResponse);
+    }
+    else if (request.key == 'removeDependency'){
+        projectManager.removeDependency(sender.tab.id, request.url, Number(request.index), sendResponse);
+    }
+    else if (request.key == 'setCustomPathData'){
+        projectManager.setCustomPathData(sender.tab.id, request.url, request.data, sendResponse);
+    }
     else{
         sendResponse({});
     }

File devtools.js

View file
  • Ignore whitespace
 }
 
 var saveMapping = function(url, path){
-	projectState.urlPathMap = projectState.urlPathMap || {};
-	projectState.urlPathMap[url] = path;
+	projectState.urlDataMap = projectState.urlDataMap || {};
+	projectState.urlDataMap[url] = path;
 	saveProjectState();
 };
-var loadProject = function(type, path, autosave, watchFiles, urlPathMap){
-	checkResources(urlPathMap);
+
+var saveFullReloadMapping = function(url, isFullReload){
+	projectState.fullReloadMap = projectState.fullReloadMap || {};
+	projectState.fullReloadMap[url] = isFullReload;
+	saveProjectState();
+};
+
+var isFullReload = function(url){
+	projectState.fullReloadMap = projectState.fullReloadMap || {};
+	return projectState.fullReloadMap[url];
+}
+
+var getMapping = function(url){
+	projectState.urlDataMap = projectState.urlDataMap || {};
+	return projectState.urlDataMap[url] || {};
+}
+var loadProject = function(type, path, autosave, watchFiles, urlDataMap, fullReloadMap){
+	checkResources(urlDataMap);
 	registerNavListener();
 	
 	toggleWatchingFiles(watchFiles, path);
-	projectState = {type: type, path: path, autosave:autosave, watchFiles:watchFiles, urlPathMap: urlPathMap};
+	projectState = {type: type, path: path, autosave:autosave, watchFiles:watchFiles, urlDataMap: urlDataMap, fullReloadMap:fullReloadMap};
 	saveProjectState();
 };
 
 		// file protocol is a special case
 		var type,path,temp;
 		var maybeLoadProject = function(){
-			var urlPathMap = temp.urlPathMap || {}
+			var urlDataMap = temp.urlDataMap || {};
+			var fullReloadMap = temp.fullReloadMap || {}
 			if (type && path && projectState.path != path){
-				backgroundMsgSupport.loadProject(type, path, inspectedLocation.origin, urlPathMap, function(data){
+				backgroundMsgSupport.loadProject(type, path, inspectedLocation.origin, urlDataMap, function(data){
 					if (data.error){
 						logError(data.error);
 					}
 					else{
-						loadProject(type, path, temp.autosave, temp.watchFiles, urlPathMap);
+						loadProject(type, path, temp.autosave, temp.watchFiles, urlDataMap, fullReloadMap);
 					}
 				});
 			}
 });
 
 $(window).bind('resourceRefresh', function(){
-	if (!editorPanelWindow){
+	if (!window.editorPanelWindow){
 		return;
 	}
 	editorPanelWindow.clearResources();
 });
 
 $(window).bind('resourceItem', function(e, resources){
-	if (!editorPanelWindow){
+	if (!window.editorPanelWindow){
 		return;
 	}
 	editorPanelWindow.refreshResources(resources);
 });
 $(window).bind('resourceConfirm', function(e, resource, isUserMapped){
-	if (!editorPanelWindow){
+	if (!window.editorPanelWindow){
 		return;
 	}
 	editorPanelWindow.updateResource(resource, isUserMapped);

File editorpanel.css

View file
  • Ignore whitespace
      margin: 0;
      padding: 0;
      margin-top: 5px;
-     margin-left: 10px;
+     margin-left: 70px;
    }
    
 

File editorpanel.js

View file
  • Ignore whitespace
 };
 var updateResource = function(resource, isUserMapped){
     var paths = resource.paths || {};
-    var $item = $('.details[data-url="' + resource.url +'"]');
-    updateResourceData($item, paths, isUserMapped);
+    var $item = $('.resource[data-url="' + resource.url +'"]');
+    updateResourceData(resource.url, $item, paths, isUserMapped);
 };
-var updateResourceData = function($item, paths, isUserMapped){
+
+var updateResourceData = function(url, $item, paths, isDocument, isUserMapped){
     if (isUserMapped){
         $item.addClass('user-mapped');
     }
         $item.removeClass('user-mapped');
     }
 
-    $('.resource-localpath span', $item).text(paths.autoSave ? paths.autoSave : 'None');
+    if (paths.autoSave){
+        $('.resource-localpath span', $item).text(paths.autoSave);
+    }
+    else if (paths.autoReload && paths.autoReload.length){
+        $('.resource-localpath span', $item).text(paths.autoReload[0]);   
+    }
     $('.auto-refresh-item', $item).remove();
-    if (paths.autoReload){
-        for (var j = 0; j < paths.autoReload.length; j++){
-            $('.resource-reloadfrom li:last-child', $item).before('<li class="auto-refresh-item">' + paths.autoReload[j] + '&nbsp;<a data-index="' + j + '" href="#" class="remove-file">Remove</a></li>');
+    $('.resource-reloadfrom', $item).hide();
+    if (paths.autoReload && paths.autoReload.length > 1){ 
+        $('.resource-reloadfrom', $item).show();
+        for (var j = 1; j < paths.autoReload.length; j++){
+            $('.resource-reloadfrom ul', $item).append('<li class="auto-refresh-item">' + paths.autoReload[j] + '&nbsp;<a data-index="' + j + '" href="#" class="remove-file">Remove</a></li>');
         }
     }
+    updateResourceActions(url, $item, paths, isDocument);
+    updateResourceOptions(url, $item, paths, isDocument);
+
 };
+
+var updateResourceActions = function(url, $item, paths, isDocument){
+    var $actions = $('.resource-actions', $item);
+    $actions.empty();
+
+    if (paths.autoReload || paths.autoSave){
+        $actions.append('<a href="#" class="browse-autosave-file">Change File Path</a>');
+        if (paths.autoReload && paths.autoReload.length){
+           $actions.append('<span> | </span><a href="#" class="browse-add-autorefresh-file">Add Dependency</a>'); 
+        } 
+    }
+    else{
+        $actions.append('<a href="#" class="browse-autosave-file">Set File Path</a>');
+    }
+
+    var data = paths;
+    $('.browse-autosave-file', $item).click(function(){
+        backgroundMsgSupport.launchFileSelect(url, 'autosave', function(data){
+            //$('.resource-localpath span', $item).text(data.localPath);
+            updateResourceData(url, $item, data, isDocument, true);
+            window.devtoolsWindow.saveMapping(url, data);
+        });
+        return false;
+    });
+
+    // deal with adding a file for auto refresh
+    $('.browse-add-autorefresh-file', $item).click(function(){
+        backgroundMsgSupport.launchFileSelect(url, 'add-autorefresh', function(data){
+            updateResourceData(url, $item, data, isDocument, true);
+            window.devtoolsWindow.saveMapping(url, data);
+        });
+        return false;
+    });
+
+    $('.remove-file', $item).click(function(){
+        backgroundMsgSupport.removeDependency(url, $(this).attr('data-index'), function(data){
+            updateResourceData(url, $item, data, isDocument, true);
+            window.devtoolsWindow.saveMapping(url, data);
+        });
+        return false;
+    });
+}
+
+var updateResourceOptions = function(url, $item, paths, requiresFull){
+    var $options = $('.resource-options', $item);
+
+    if (paths.autoSave){
+        //$('.auto-refresh-checkbox', $options).prop('checked', false);
+        $('.auto-refresh-checkbox', $options).prop('checked', false);
+        $('input', $options).prop('disabled', false);
+    }
+    else if (paths.autoReload && paths.autoReload.length){
+        //$('.auto-save-checkbox', $options).prop('checked', false);
+        $('.auto-refresh-checkbox', $options).prop('checked', true);
+        $('input', $options).prop('disabled', false);
+    }
+    else{
+        $('.auto-refresh-checkbox', $options).prop('checked', false).prop('disabled', true);
+        //$('.auto-save-checkbox', $options).prop('checked', false).prop('disabled', true);
+        $('.full-refresh-checkbox', $options).prop('disabled', true);
+    }
+    if (window.devtoolsWindow.isFullReload(url)){
+        $('.full-refresh-checkbox', $options).prop('checked', true);
+    }
+    else{
+        $('.full-refresh-checkbox', $options).prop('checked', false);
+    }
+    if (requiresFull){
+         $('.full-refresh-checkbox', $options).prop('checked', true).prop('disabled', true);
+    }
+}
+
+var registerOptionChangeHandlers = function(url, $item, requiresFull){
+    var $autoRefeshCheckbox = $('.auto-refresh-checkbox', $item);
+    var $fullRefreshCheckbox = $('.full-refresh-checkbox', $item);
+    var updateAll = function(){
+        backgroundMsgSupport.setResourceOptions(url, !$autoRefeshCheckbox[0].checked, function(paths){
+            updateResourceData(url, $item, paths, requiresFull, true);
+            window.devtoolsWindow.saveMapping(url, paths);
+        });
+        return false;
+    };
+    $autoRefeshCheckbox.click(updateAll);
+    $fullRefreshCheckbox.change(function(){
+        window.devtoolsWindow.saveFullReloadMapping(url, this.checked);
+    });
+}
+
 var refreshResources = function(resourceCache){
     var urlParser = document.createElement('a');
     var inspectedOrigin = devtoolsWindow.inspectedLocation.origin;
             <div class="details">\
                 <div class="resource-name">test.js</div>\
                 <div class="resource-url">Url: /something/something/test.js</div>\
-                <div class="resource-localpath">Auto-Save Path: <span>None</span>&nbsp;<a href="#" class="browse-autosave-file">Change</a></div>\
-                <div class="resource-reloadfrom">Auto-Refresh Paths \
+                <div class="resource-localpath">File Path: <span>None</span></div>\
+                <div style="display:none" class="resource-reloadfrom">\
                     <ul>\
-                        <li><a href="#" class="browse-add-autorefresh-file">Add</a></li>\
                     </ul>\
                 </div>\
+                <div class="resource-actions">\
+                    <a href="#" class="browse-autosave-file">Set File</a>\
+                </div>\
                 <div class="resource-options">\
                     <label>\
-                        <input type="checkbox" />\
+                        <input name="resource-match-type' + i + '" class="auto-refresh-checkbox" type="checkbox" />\
+                        <span>Generated from another language</span>\
+                    </label>\
+                    <label>\
+                        <input class="full-refresh-checkbox" type="checkbox" />\
                         <span>Auto-Refresh performs a full refresh of the page</span>\
                     </label>\
                 </div>\
         var filename = urlParser.pathname.substring(urlParser.pathname.lastIndexOf('/') + 1);
         var url = urlParser.origin === inspectedOrigin ? resource.url.substring(inspectedOrigin.length) : resource.url;
         var $item = $(template);
+        $item.appendTo($resourceList);
         
-        $item.attr('data-url', url);
+        $item.attr('data-url', resource.url);
         $('.resource-name', $item).text(filename.length ? filename : '/');
         $('.resource-url', $item).text('URL: ' + url);
 
         var paths = resource.paths || {};
-        updateResourceData($item, paths, false);
+        updateResourceData(resource.url, $item, paths, type == 'document', false);
+        //updateResourceActions($item, paths);
+        //updateResourceOptions($item, paths, type == 'document');
         
-
-        // deal with a change to the 1-to-1 mapping
-        $('.browse-autosave-file', $item).click((function(url, $item){
-            return function(){
-                backgroundMsgSupport.launchFileSelect(url, 'autosave', function(data){
-                    //$('.resource-localpath span', $item).text(data.localPath);
-                    updateResourceData($item, data, true);
-                    window.devtoolsWindow.saveMapping(url, data);
-                });
-            }
-        }(resource.url, $item)));
-
-        // deal with adding a file for auto refresh
-        $('.browse-add-autorefresh-file', $item).click((function(url, $item){
-            return function(){
-                backgroundMsgSupport.launchFileSelect(url, 'add-autorefresh', function(data){
-                    updateResourceData($item, data, true);
-                    window.devtoolsWindow.saveMapping(url, data);
-                });
-            }
-        }(resource.url, $item)));
-
-        $item.appendTo($resourceList);
+        registerOptionChangeHandlers(resource.url, $item, type == 'document');
     }
 };
 

File images/resourceCSSIcon.png

  • Ignore whitespace
Added
New image

File images/resourceDocumentIcon.png

  • Ignore whitespace
Added
New image

File images/resourceJSIcon.png

  • Ignore whitespace
Added
New image

File lastnode.png

  • Ignore whitespace
Added
New image

File node.png

  • Ignore whitespace
Added
New image

File vline.png

  • Ignore whitespace
Added
New image