diff options
| author | unknown | 2011-03-08 20:11:46 +0800 | 
|---|---|---|
| committer | unknown | 2011-03-08 20:11:46 +0800 | 
| commit | 3e1c9cf9f1792d3e9b7ef8dba74f4a9ae09d90fe (patch) | |
| tree | cf9db8bc919edea3ddd2ba119444df5d3b523ed8 | |
| parent | 447746ce40c1eb161d0593067d739cf70d0d5c8e (diff) | |
| download | vimium-3e1c9cf9f1792d3e9b7ef8dba74f4a9ae09d90fe.tar.bz2 | |
issue 315: Suggest to add previous and next page pattern config
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | background_page.html | 4 | ||||
| -rw-r--r-- | options.html | 24 | ||||
| -rw-r--r-- | vimiumFrontend.js | 8 | 
4 files changed, 32 insertions, 5 deletions
| @@ -22,5 +22,6 @@ Contributors:    Werner Laurensse (github: ab3)    Svein-Erik Larsen <feinom@gmail.com> (github: feinom)    R.T. Lechow <rtlechow@gmail.com> (github: rtlechow) +  Wang Ning <daning106@gmail.com> (github:daning)  Feel free to add real names in addition to GitHub usernames. diff --git a/background_page.html b/background_page.html index 0e47bbf7..2be1e7b2 100644 --- a/background_page.html +++ b/background_page.html @@ -31,7 +31,9 @@        ".vimiumHintMarker {\n\n}\n" +        ".vimiumHintMarker > .matchingCharacter {\n\n}",      excludedUrls: "http*://mail.google.com/*\n" + -                  "http*://www.google.com/reader/*\n" +                  "http*://www.google.com/reader/*\n", +    previousPatterns: "\\bprev\\b,\\bprevious\\b,\\u00AB,<<,<", +    nextPatterns: "\\bnext\\b,\\u00BB,>>,\\bmore\\b,>"    };    // This is the base internal link hints CSS. It's combined with the userDefinedLinkHintCss before diff --git a/options.html b/options.html index 4e2f6ecc..627560f8 100644 --- a/options.html +++ b/options.html @@ -78,7 +78,7 @@    var defaultSettings = chrome.extension.getBackgroundPage().defaultSettings;    var editableFields = ["scrollStepSize", "defaultZoomLevel", "excludedUrls", "linkHintCharacters", -                        "userDefinedLinkHintCss", "keyMappings"]; +                        "userDefinedLinkHintCss", "keyMappings", "previousPatterns", "nextPatterns"];    var canBeEmptyFields = ["excludedUrls", "keyMappings", "userDefinedLinkHintCss"]; @@ -243,6 +243,28 @@            <textarea id="userDefinedLinkHintCss" type="text"></textarea>          </td>        </tr> +      <tr class="advancedOption"> +        <td class="caption">Previous Patterns</td> +        <td verticalAlign="top"> +            <div class="help"> +              <div class="example"> +                The Patterns split by ','. +              </div> +            </div> +            <input id="previousPatterns" type="text" style="width:320px" /> +        </td> +      </tr> +      <tr class="advancedOption"> +        <td class="caption">Next Patterns</td> +        <td verticalAlign="top"> +            <div class="help"> +              <div class="example"> +                The Patterns split by ','. +              </div> +            </div> +            <input id="nextPatterns" type="text" style="width:320px" /> +        </td> +      </tr>      </table>      <div id="buttonsPanel"> diff --git a/vimiumFrontend.js b/vimiumFrontend.js index b14e02cc..0e8bdbb5 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -5,7 +5,7 @@   * commands by connectiong to a port named "domReady".   */  var settings = {}; -var settingsToLoad = ["scrollStepSize", "linkHintCharacters"]; +var settingsToLoad = ["scrollStepSize", "linkHintCharacters", "previousPatterns", "nextPatterns"];  var getCurrentUrlHandlers = []; // function(url) @@ -592,12 +592,14 @@ function findAndFollowRel(value) {  }  function goPrevious() { -  var previousStrings = ["\bprev\b","\bprevious\b","\u00AB","<<","<"]; +  var previousPatterns = settings["previousPatterns"] || ""; +  var previousStrings = previousPatterns.split(",");    findAndFollowRel('prev') || findAndFollowLink(previousStrings);  }  function goNext() { -  var nextStrings = ["\bnext\b","\u00BB",">>","\bmore\b",">"]; +  var nextPatterns = settings["nextPatterns"] || ""; +  var nextStrings = nextPatterns.split(",");    findAndFollowRel('next') || findAndFollowLink(nextStrings);  } | 
