PHP Classes

File: public/js/tinymce/src/plugins/visualblocks/src/main/js/core/LoadCss.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/visualblocks/src/main/js/core/LoadCss.js   Download  
File: public/js/tinymce/src/plugins/visualblocks/src/main/js/core/LoadCss.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 947 bytes
 

Contents

Class file image Download
/** * LoadCss.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.plugins.visualblocks.core.LoadCss', [ 'tinymce.core.dom.DOMUtils', 'tinymce.core.util.Tools' ], function (DOMUtils, Tools) { var cssId = DOMUtils.DOM.uniqueId(); var load = function (doc, url) { var linkElements = Tools.toArray(doc.getElementsByTagName('link')); var matchingLinkElms = Tools.grep(linkElements, function (head) { return head.id === cssId; }); if (matchingLinkElms.length === 0) { var linkElm = DOMUtils.DOM.create('link', { id: cssId, rel: 'stylesheet', href: url }); doc.getElementsByTagName('head')[0].appendChild(linkElm); } }; return { load: load }; } );