Comments (1)
You can create a new .js file with the following code, it's a little "hack" that allows you to replace the .setAttribute, more info in the webpage https://csplite.com/csp/test343/
`var setAttribute_ = Element.prototype.setAttribute; // Save source of Elem.setAttribute funct
Element.prototype.setAttribute = function (attr, val) {
if (attr.toLowerCase() !== 'style') {
setAttribute_.apply(this, [attr, val]); // Call the saved native Elem.setAttribute funct
}
else { // 'color:red; background-color:#ddd' -> el.style.color='red'; el.style.backgroundColor='#ddd';
var arr = val.split(';').map((el, index) => el.trim());
for (var i = 0, tmp; i < arr.length; ++i) {
if (! /:/.test(arr[i])) continue; // Empty or wrong
tmp = arr[i].split(':').map((el, index) => el.trim());
this.style[camelize(tmp[0])] = tmp[1];
//console.log(camelize(tmp[0]) + ' = '+ tmp[1]);
}
}
}
function camelize(str) {
return str
.split('-') // Parse 'my-long-word' to ['my', 'long', 'word']
.map(
// Coverts all elements to uppercase except first: ['my', 'long', 'word'] -> ['my', 'Long', 'Word']
(word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)
)
.join(''); // Join ['my', 'Long', 'Word'] to 'myLongWord'
}`
from waves.
Related Issues (20)
- provide some method to get (default) options HOT 2
- inline styles from TagWrapper are problematic
- Why i tag with waves-effect class appears around img? HOT 2
- My own crypto on android phone HOT 1
- Please reopen #131, it's still broken (+ solution)
- Any chance Waves will be added to npm registry? HOT 1
- semantic ui dropdown error
- unclear attach docs
- Waves builder (demo) HOT 7
- Current project status
- Waves on enter key?
- How can I remove the shadow?
- Can I change waves color
- AMP version?
- Cannot use import statement outside a module
- Use waves with webpack
- CSS zoom breaks effect origin point
- Choose ripple color depending on background color of button HOT 1
- Website is down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waves.