Merge remote-tracking branch 'upstream/master'

* upstream/master:
  update locales
  typo
  update package.json
  CodeMirror v5.40.0
  actually copy codemirror.js before patching
  FF bug workaround: set style element code in page context
This commit is contained in:
dana 2018-08-25 10:28:54 -07:00
commit e287535840
40 changed files with 220 additions and 74 deletions

View File

@ -1185,7 +1185,7 @@
"description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59"
},
"unreachableAMOHintNewFF": {
"message": "In Firefox 60 and newer you'll also have to to remove AMO domain from <extensions.webextensions.restrictedDomains> in <about:config>.",
"message": "In Firefox 60 and newer you'll also have to remove AMO domain from <extensions.webextensions.restrictedDomains> in <about:config>.",
"description": "Note in the popup when opened on addons.mozilla.org in Firefox >= 59"
},
"unreachableAMOHintOldFF": {

View File

@ -2,9 +2,6 @@
"appliesRemoveError": {
"message": "Cannot remove last 'applies to' entry"
},
"applyAllUpdates": {
"message": "Apply all updates"
},
"checkAllUpdatesForce": {
"message": "Check again—I didn't edit any styles!"
},
@ -20,18 +17,9 @@
"colorpickerTooltip": {
"message": "Open colour picker"
},
"confirmDiscardChanges": {
"message": "Discard the changes?"
},
"deleteStyleConfirm": {
"message": "Are you sure you want to delete this style?"
},
"description": {
"message": "Redesign the web with Stylus, a user-style manager. Stylus allows you to easily install themes and skins for many popular sites."
},
"dragDropMessage": {
"message": "Drop your backup file anywhere on this page to import."
},
"editGotoLine": {
"message": "Go to line (or line:col)"
},

View File

@ -394,6 +394,9 @@
"installUpdateFromLabel": {
"message": "Kontrolli uuendusi"
},
"installUpdateUnavailable": {
"message": "Uuenduste kontrollimise lubamiseks lohista failid kaartide ribale või määratle stiili metaandmetes @updateURL."
},
"license": {
"message": "Litsents"
},
@ -406,6 +409,9 @@
"linkStylusWiki": {
"message": "Viki"
},
"linkTranslate": {
"message": "Tõlgi"
},
"linterCSSLintIncompatible": {
"message": "CSSLint ei toeta eeltöötlejat $preprocessorname$",
"placeholders": {
@ -968,6 +974,9 @@
"updatesCurrentlyInstalled": {
"message": "Uuendused paigaldatud:"
},
"usercssAvoidOverwriting": {
"message": "Olemasoleva stiili ülekirjutamise vältimiseks palun muuda @name või @namespace väärtused."
},
"usercssConfigIncomplete": {
"message": "Stiili uuendati või eemaldati pärast seadistusdialoogi kuvamist. Neid muutujaid ei salvestatud, et vältida stiili metaandmete korrumpeerumist:"
},

View File

@ -962,6 +962,9 @@
"updatesCurrentlyInstalled": {
"message": "Mises à jour installées :"
},
"usercssAvoidOverwriting": {
"message": "Veuillez changer la valeur de @name ou @namespace afin d'éviter d'écraser un style pré-existant."
},
"usercssConfigIncomplete": {
"message": "Le style a été mis à jour ou supprimer après lapparition du dialogue de confirmation. Ces variables nont pas été sauvegardées pour éviter de corrompre les métadonnées du style :"
},

View File

@ -406,6 +406,9 @@
"linkGetStyles": {
"message": "スタイルを取得"
},
"linkStylusWiki": {
"message": "ウィキ"
},
"linkTranslate": {
"message": "翻訳"
},
@ -971,6 +974,9 @@
"updatesCurrentlyInstalled": {
"message": "更新がインストールされました:"
},
"usercssAvoidOverwriting": {
"message": "既存のスタイルの上書きを避けるために、@name または @namespace の値を変更してください。"
},
"usercssConfigIncomplete": {
"message": "設定ダイアログの表示後に、スタイルが更新または削除されました。スタイルのメタデータの破損を避けるため、これらの変数は保存されませんでした:"
},

View File

@ -980,6 +980,9 @@
"updatesCurrentlyInstalled": {
"message": "Zainstalowane aktualizacje:"
},
"usercssAvoidOverwriting": {
"message": "Proszę zmienić wartość @name lub @namespace, aby uniknąć nadpisania istniejącego stylu."
},
"usercssConfigIncomplete": {
"message": "Styl został zaktualizowany lub usunięty po wyświetleniu okna dialogowego konfiguracji. Te zmienne nie zostały zapisane, aby uniknąć uszkodzenia metadanych stylu:"
},

View File

@ -962,6 +962,9 @@
"updatesCurrentlyInstalled": {
"message": "Atualizações instaladas:"
},
"usercssAvoidOverwriting": {
"message": "Por favor modifique o valor de @name ou @namespace para evitar sobrescrever um estilo existente."
},
"usercssConfigIncomplete": {
"message": "O estilo foi atualizado ou eliminado após a exibição do diálogo de configuração. Essas variáveis não foram guardadas para evitar corromper os metadados do estilo:"
},

View File

@ -106,6 +106,12 @@
"cm_resizeGripHint": {
"message": "Dublu click pentru a maximiza sau restaura înălțimea"
},
"cm_selectByTokens": {
"message": "Dublu-click pentru a selecta simbolurile"
},
"cm_selectByTokensTooltip": {
"message": "Exemple de simboluri: .foo-bar-2 #aabbcc 0.32 !important\nCand inactiv: cuvinte delimitate cu punctuatie sunt selectate."
},
"cm_smartIndent": {
"message": "Folosiți indentare inteligentă"
},
@ -236,6 +242,12 @@
"findStylesInlineTooltip": {
"message": "Arătați rezultatele căutării în această pagină."
},
"genericAdd": {
"message": "Adaugă"
},
"genericClone": {
"message": "Clonează"
},
"genericDisabledLabel": {
"message": "Dezactivat"
},
@ -340,6 +352,9 @@
"installUpdateFromLabel": {
"message": "Verificați update-urile"
},
"installUpdateUnavailable": {
"message": "Pentru a activa verificarea de updates. trage fișierul pe taburi (zona cu titluri) sau specifica @updateURL în metadata temei."
},
"license": {
"message": "Licență"
},
@ -349,6 +364,9 @@
"linkGetStyles": {
"message": "Căutați teme"
},
"linkTranslate": {
"message": "Traduce"
},
"linterCSSLintIncompatible": {
"message": "CSSLint nu suportă preprocesorul $preprocessorname$ ",
"placeholders": {
@ -394,6 +412,12 @@
"liveReloadError": {
"message": "A avut loc o eroare în timpul monitorizării acestui fișier"
},
"liveReloadInstallHint": {
"message": "Reload automat este activat deci tema instalată va fi updatată automat când acest tab si fișierul surca sunt deschise."
},
"liveReloadUnavailable": {
"message": "Pentru a activa live reload (refresh automat), trage fișierul pe taburi (zona unde titlurile temelor sunt afișate) "
},
"manageFavicons": {
"message": "Favicons în coloana 'se aplică la'"
},
@ -469,6 +493,9 @@
"optionsAdvancedExposeIframes": {
"message": "Expuneți iframes via HTML[stylus-iframe]"
},
"optionsAdvancedExposeIframesNote": {
"message": "Expune domain-ul site-ului in fiecare iframe.\nActivează scrierea de CSS specific pentru iframe precum:\nhtml[stylus-iframe$=\"twitter.com\"] h1 { display:none }"
},
"optionsAdvancedNewStyleAsUsercss": {
"message": "Scrieți temă nouă în formatul usercss"
},
@ -568,6 +595,9 @@
"prefShowBadge": {
"message": "Numărul de teme active pentru site-ul curent"
},
"previewTooltip": {
"message": "Aplică temporar modificările fără a salva.\nSalvează tema pentru a face schimbările permanente."
},
"replace": {
"message": "Înlocuiți"
},
@ -622,6 +652,9 @@
"sectionRemove": {
"message": "Ștergeți secțiunea"
},
"sectionRestore": {
"message": "Restaurează o secțiune ștearsă"
},
"shortcutsNote": {
"message": "Creeați keyboard shortcuts"
},
@ -655,6 +688,9 @@
"styleBeautifyIndentConditional": {
"message": "Indentare @media, @supports"
},
"styleBeautifyPreserveNewlines": {
"message": "Menține linii noi"
},
"styleCancelEditLabel": {
"message": "Înapoi la manager"
},
@ -810,6 +846,9 @@
"unreachableAMOHint": {
"message": "Pentru a permite accesul deschideți <about:config>, right-click pe listă, click 'New', apoi 'Boolean', paste <privacy.resistFingerprinting.block_mozAddonManager> și click OK, <true>, OK, reâncărcați pagina <addons.mozilla.org>."
},
"unreachableAMOHintNewFF": {
"message": "În Firefox 60+ va trebui sa fie șters domain-ul AMO din <extensions.webextensions.restrictedDomains> din <about:config>."
},
"unreachableAMOHintOldFF": {
"message": "Doar Firefox 59 sau mai nou poate fi configurat să permită WebExtension-urilor să adauge elemente la site-uri CSP-protected precum acesta."
},
@ -860,6 +899,9 @@
"updatesCurrentlyInstalled": {
"message": "Update-uri instalate:"
},
"usercssAvoidOverwriting": {
"message": "Vă rugăm să modificați valoarea @name și @namespace pentru a împiedica scrierea peste o temă existentă."
},
"usercssConfigIncomplete": {
"message": "Tema a fost updatată sau ștearsă după ce configurațiile au fost afișate. Aceste variabile nu au fost salvate pentru a nu corupe metadata temei."
},
@ -872,6 +914,9 @@
"usercssReplaceTemplateName": {
"message": "@name este gol și înlocuiețte valoarea de bază"
},
"usercssReplaceTemplateSectionBody": {
"message": "Introduce cod aici..."
},
"versionInvalidOlder": {
"message": "Versiunea este mai veche decât cea instalată."
},

View File

@ -5,6 +5,9 @@
"addStyleTitle": {
"message": "Lägg till stil"
},
"alphaChannel": {
"message": "Opacitet"
},
"appliesAdd": {
"message": "Lägg till"
},
@ -46,6 +49,9 @@
"applyAllUpdates": {
"message": "Verkställ alla uppdateringar"
},
"bckpInstStyles": {
"message": "Exportera stilar"
},
"checkAllUpdates": {
"message": "Sök efter uppdateringar"
},
@ -129,9 +135,15 @@
"externalUsercssDocument": {
"message": "Dokumentation för Usercss"
},
"findStyles": {
"message": "Hitta stilar"
},
"findStylesForSite": {
"message": "Hitta fler stilar för denna sida"
},
"genericAdd": {
"message": "Lägg till"
},
"genericDisabledLabel": {
"message": "Inaktiverad"
},
@ -141,6 +153,15 @@
"genericHistoryLabel": {
"message": "Historik"
},
"genericNext": {
"message": "Nästa"
},
"genericPrevious": {
"message": "Föregående"
},
"genericResetLabel": {
"message": "Återställ"
},
"helpAlt": {
"message": "Hjälp"
},
@ -165,6 +186,18 @@
"linkGetStyles": {
"message": "Skaffa stilar"
},
"linkTranslate": {
"message": "Översätt"
},
"manageFavicons": {
"message": "Ikoner i 'Gäller för' kolumnen"
},
"manageFaviconsGray": {
"message": "Nedtonade"
},
"manageFaviconsHelp": {
"message": "Stylus använder en extern tjänst https://www.google.com/s2/favicons"
},
"manageFilters": {
"message": "Filter"
},
@ -201,12 +234,39 @@
"openManage": {
"message": "Hantera installerade stilar"
},
"openOptionsPopup": {
"message": "Alternativ"
},
"openStylesManager": {
"message": "Öppna stilhanteraren"
},
"optionsAdvancedNewStyleAsUsercss": {
"message": "Skriv ny stil som Usercss"
},
"optionsCheck": {
"message": "Uppdatera stilar"
},
"optionsCheckUpdate": {
"message": "Leta efter och installera alla tillgängliga uppdateringar"
},
"optionsHeading": {
"message": "Alternativ"
},
"optionsOpenManager": {
"message": "Hantera stilar"
},
"optionsReset": {
"message": "Återställ alternativen till standard"
},
"optionsResetButton": {
"message": "Återställ alternativ"
},
"paginationNext": {
"message": "Nästa sida"
},
"paginationPrevious": {
"message": "Föregående sida"
},
"popupStylesFirst": {
"message": "Lista stilar före kommandon i verktygsfältets knappmeny"
},
@ -222,6 +282,9 @@
"replaceWith": {
"message": "Ersätt med"
},
"retrieveBckp": {
"message": "Importera stilar"
},
"search": {
"message": "Sök"
},
@ -243,6 +306,15 @@
"sectionRemove": {
"message": "Ta bort sektion"
},
"sectionRestore": {
"message": "Återställ borttagen sektion"
},
"shortcuts": {
"message": "Genvägar"
},
"shortcutsNote": {
"message": "Ställ in tangentbordsgenvägar"
},
"styleBadRegexp": {
"message": "Regexp:en är ogiltig"
},

View File

@ -703,6 +703,9 @@
"sectionRemove": {
"message": "删除此部分"
},
"sectionRestore": {
"message": "撤销删除"
},
"shortcuts": {
"message": "快捷键"
},

View File

@ -299,13 +299,19 @@
// HTML document style; also works on HTML-embedded SVG
el = document.createElement('style');
}
Object.assign(el, {
id,
type: 'text/css',
textContent: code,
});
el.id = id;
el.type = 'text/css';
// SVG className is not a string, but an instance of SVGAnimatedString
el.classList.add('stylus');
if (!CHROME && (
// FF bug workaround, see https://github.com/openstyles/stylus/issues/461
location.hostname === 'www.barclaycardus.com' ||
location.hostname === 'www.icloud.com'
)) {
setContentsInPageContext(el, code);
} else {
el.textContent = code;
}
addStyleElement(el);
}
styleElements.set(id, el);
@ -313,6 +319,18 @@
return el;
}
function setContentsInPageContext(el, code) {
const originalId = el.id;
el.id += performance.now();
// when adding to ROOT we don't want our observer to pop up so we use a DIV wrapper
(document.head || ROOT.appendChild(document.createElement('div'))).appendChild(el);
(document.head || ROOT).appendChild(document.createElement('script')).text = `
document.currentScript.remove();
document.getElementById('${el.id}').textContent = ${JSON.stringify(code)};`;
if (!document.head) el.parentNode.remove();
el.id = originalId;
}
function addStyleElement(newElement) {
if (!ROOT) {
return;
@ -443,7 +461,6 @@
function initDocRootObserver() {
let lastRestorationTime = 0;
let restorationCounter = 0;
let scheduledSort = false;
let observing = false;
let sorting = false;
let observer;
@ -504,24 +521,13 @@
return true;
}
}
function sortStyleElements({force} = {}) {
if (!observing ||
!force && scheduledSort) {
return;
}
scheduledSort = false;
function sortStyleElements() {
if (!observing) return;
let prevExpected = document.documentElement.lastElementChild;
while (prevExpected && isSkippable(prevExpected, true)) {
prevExpected = prevExpected.previousElementSibling;
}
if (!prevExpected) {
return;
}
if (!CHROME && !force && window !== top) {
requestAnimationFrame(() => sortStyleElements({force: true}));
scheduledSort = true;
return;
}
if (!prevExpected) return;
for (const el of styleElements.values()) {
if (!isMovable(el)) {
continue;

View File

@ -7,7 +7,11 @@
"author": "Stylus Team",
"devDependencies": {
"archiver": "^3.0.0",
<<<<<<< HEAD
"codemirror": "^5.39.2",
=======
"codemirror": "^5.40.0",
>>>>>>> upstream/master
"eslint": "^5.4.0",
"fs-extra": "^7.0.0",
"jsonlint": "^1.6.3",
@ -17,7 +21,11 @@
"semver-bundle": "^0.1.1",
"stylelint-bundle": "^8.0.0",
"stylus-lang-bundle": "^0.54.5",
<<<<<<< HEAD
"updates": "^4.2.0"
=======
"updates": "^4.2.1"
>>>>>>> upstream/master
},
"scripts": {
"lint": "eslint **/*.js || true",

View File

@ -60,10 +60,7 @@ function updateExisting(lib) {
const folderRoot = `${vendorRoot}${folder}`;
const entries = fs.readdirSync(folderRoot);
entries.forEach(entry => {
// Remove $1 from "CodeMirror$1" in codemirror.js
if (entry === 'codemirror.js') {
renameCodeMirrorVariable(`${folderRoot}/${entry}`);
} else if (entry !== 'README.md' && entry !== 'LICENSE') {
if (entry !== 'README.md' && entry !== 'LICENSE') {
// Ignore README.md & LICENSE files
const entryPath = `${folderRoot}/${entry}`;
try {
@ -72,6 +69,10 @@ function updateExisting(lib) {
folders.push(`${folder}/${entry}`);
} else {
fs.copySync(`${libRoot}${folder}/${entry}`, entryPath);
// Remove $1 from "CodeMirror$1" in codemirror.js
if (entry === 'codemirror.js') {
renameCodeMirrorVariable(entryPath);
}
}
}
} catch (err) {

View File

@ -1,3 +1,3 @@
## CodeMirror v5.39.2
## CodeMirror v5.40.0
Only files & folders that exist in the `vendor/codemirror` folder are copied from the `node_modules/codemirror` folder. Except all theme files are copied, in case new themes have been added.

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Open simple dialogs on top of an editor. Relies on dialog.css.

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
@ -136,9 +136,7 @@
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
else return CodeMirror.Pass;
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
isClosingBracket(next, pairs) ||
/\s/.test(next))) {
} else if (opening) {
curType = "both";
} else {
return CodeMirror.Pass;
@ -175,11 +173,6 @@
});
}
function isClosingBracket(ch, pairs) {
var pos = pairs.lastIndexOf(ch);
return pos > -1 && pos % 2 == 1;
}
function charsAround(cm, pos) {
var str = cm.getRange(Pos(pos.line, pos.ch - 1),
Pos(pos.line, pos.ch + 1));

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Depends on csslint.js from https://github.com/stubbornella/csslint

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Depends on jsonlint.js from https://github.com/zaach/jsonlint

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Highlighting text that matches the selection
//

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// A rough approximation of Sublime Text's keybindings
// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
/**
* Supported keybindings:

View File

@ -1,7 +1,7 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// This is CodeMirror (http://codemirror.net), a code editor
// This is CodeMirror (https://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
//
// You can find some technical background for some of the code below
@ -7734,6 +7734,7 @@ function defineOptions(CodeMirror) {
option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; });
option("autofocus", null);
option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true);
option("phrases", null);
}
function guttersChanged(cm) {
@ -8572,6 +8573,11 @@ var addEditorMethods = function(CodeMirror) {
return old
}),
phrase: function(phraseText) {
var phrases = this.options.phrases;
return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText
},
getInputField: function(){return this.display.input.getField()},
getWrapperElement: function(){return this.display.wrapper},
getScrollerElement: function(){return this.display.scroller},
@ -9689,7 +9695,7 @@ CodeMirror.fromTextArea = fromTextArea;
addLegacyProps(CodeMirror);
CodeMirror.version = "5.39.2";
CodeMirror.version = "5.40.0";
return CodeMirror;

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS

View File

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Distributed under an MIT license: https://codemirror.net/LICENSE
// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB