Merge branch 'master' into grammar_correction
|
@ -39,7 +39,7 @@ class Autoloader
|
|||
|
||||
$dir = new RecursiveDirectoryIterator(ROOT_DIR, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$ite = new RecursiveIteratorIterator($dir);
|
||||
$pathIterator = new RegexIterator($ite, '/.*\.class\.php$/', RegexIterator::GET_MATCH);
|
||||
$pathIterator = new RegexIterator($ite, '/.*\.php$/', RegexIterator::GET_MATCH);
|
||||
foreach($pathIterator as $paths)
|
||||
{
|
||||
foreach($paths as $path)
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
"php": ">=7.0",
|
||||
"ext-curl": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-xml": "*"
|
||||
"ext-xml": "*",
|
||||
"leafo/scssphp": "0.7.4",
|
||||
"erusev/parsedown": "^1.6",
|
||||
"erusev/parsedown-extra": "^0.7.1",
|
||||
"pelago/emogrifier": "^2.0",
|
||||
"mustangostang/spyc": "^0.6.2",
|
||||
"phpunit/phpunit": "^6.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
1723
composer.lock
generated
|
@ -2,7 +2,7 @@
|
|||
category: code
|
||||
title: Publish Open Content
|
||||
award: 500-10000+
|
||||
status: available
|
||||
status: complete
|
||||
date: '2016-07-01'
|
||||
---
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@ category: getstarted
|
|||
order: 1
|
||||
---
|
||||
|
||||
Currently, there are a couple of ways to obtain LBRY Credits or LBC for short.
|
||||
=======
|
||||
There are several ways to obtain LBRY Credits (LBC.
|
||||
|
||||
1. LBRY users get an LBC gift by way of in-app [Rewards](https://lbry.io/faq/rewards).
|
||||
1. LBRY users get LBC for [referring](https://lbry.io/faq/referrals) other users via the LBRY app (see Invites section of the wallet).
|
||||
|
|
|
@ -7,7 +7,7 @@ category: other
|
|||
|
||||
LBRY controls [millions of credits](https://lbry.io/faq/credit-policy) that it wants to get into the hands of content creators and content consumers.
|
||||
|
||||
Unfortunately, when you try to give stuff away for free, people will abuse it.
|
||||
Unfortunately, when running a rewards program, people will abuse it.
|
||||
|
||||
This and only this is the reason we require a credit card to participate in the [rewards](https://lbry.io/faq/rewards) program. We wish we could tell you were a real person without this step, but no other solution we've tried thus far has worked well. This is the fastest and easiest method to verify your identity, otherwise, please see below.
|
||||
|
||||
|
@ -19,7 +19,7 @@ Your card information is submitted directly to [Stripe](https://stripe.com), one
|
|||
|
||||
### What If I Don't Want To Provide It?
|
||||
|
||||
No problem! We've added three other verification methods - [Phone Verification](https://lbry.io/faq/phone), [YouTube Account Sync](https://lbry.io/faq/youtube) and manual verification via [Discord chat](https://chat.lbry.io). To begin manual verification, type **-new** in the #verification channel which will create a ticket (channel) for your request. **Note: DO NOT message any team members or post in other channels about verification concerns. Rewards will only be granted on a 1 account per household basis**
|
||||
No problem! We've added three other verification methods - [Phone Verification](https://lbry.io/faq/phone), [YouTube Account Sync](https://lbry.io/faq/youtube), and manual verification via [Discord chat](https://chat.lbry.io). To begin manual verification, type **-new** in the #verification channel which will create a ticket (channel) for your request. **Note: DO NOT message any team members or post in other channels about verification concerns. Rewards will only be granted on a 1 account per household basis**
|
||||
|
||||
Otherwise, you are welcome to use the LBRY browser without providing any personal information. We just can't give you any rewards.
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ If you want to run the LBRY app on multiple PCs or Windows users, you can either
|
|||
[LBRY Rewards](https://lbry.io/faq/rewards) are used to distribute LBRY Credits(LBC) to new and existing users by allowing them to explore app functions and complete tasks which generate LBC as an award. In order to be eligible for Rewards, you need to [verify your identity](https://lbry.io/faq/identity-requirements) which uniquely identifies you as an LBRY user.
|
||||
|
||||
### What is a wallet and how do I find it? {#wallet}
|
||||
A wallet is a secure, digital wallet used to store, send and receive cryptocurrencies like LBRY Credits(LBC). The LBRY App comes with its own wallet and is stored locally on your computer and nowhere else! **It is critical that you [backup your wallet data](https://lbry.io/faq/backup) in case you lose access to your PC or need to [migrate](https://lbry.io/faq/backup-data) to a new one.**
|
||||
A wallet is a secure, digital wallet used to store, send and receive cryptocurrencies like LBRY Credits(LBC). The LBRY App comes with its own wallet and is stored locally on your computer and nowhere else! **It is critical that you [backup your wallet data](https://lbry.io/faq/how-to-backup-wallet) in case you lose access to your PC or need to [migrate](https://lbry.io/faq/backup-data) to a new one.**
|
||||
|
||||
In the app, you can find your wallet in the top-right hand corner, next to the bank icon. Clicking it will bring you to the wallet overview page which shows your balance, available Rewards and recent transactions.
|
||||

|
||||
|
|
|
@ -7,7 +7,7 @@ category: other
|
|||
|
||||
LBRY controls [millions of credits](https://lbry.io/faq/credit-policy) that it wants to get into the hands of content creators and content consumers.
|
||||
|
||||
Unfortunately, when you try to give stuff away for free, people will abuse it.
|
||||
Unfortunately, when running a rewards program, people will abuse it.
|
||||
|
||||
Phone number verification provides another method for LBRY users to participate in the [rewards](https://lbry.io/faq/rewards) program.
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ For live help, you can join [our chat](https://chat.lbry.io) and post in the #he
|
|||
|
||||
## Help via Email
|
||||
|
||||
You can also [email LBRY](mailto:help@lbry.io) with questions or issues. LBRY log files are a good source of information for us; you can learn how to [find them here](https://lbry.io/faq/how-to-find-lbry-log-file).
|
||||
You can also [email LBRY](mailto:help@lbry.io) with questions or issues. LBRY log files will help us better understand the issue you are experiencing, you can learn how to [find them here](https://lbry.io/faq/how-to-find-lbry-log-file) and attach with your email.
|
||||
|
||||
### Reporting Issues
|
||||
|
||||
|
|
|
@ -15,11 +15,15 @@ By agreeing to sync your content to the LBRY network, you agree to the terms spe
|
|||
This Agreement lasts twelve (12) months from the date that the Content is uploaded to your Channel on LBRY. After that time, your content will continue to be on the LBRY Network under the terms of this agreement for successive 6-month periods; if you decide to revoke your content, it will be taken down within 30 days of LBRY receiving notice from you.
|
||||
|
||||
### 2. Receiving LBRY Credits
|
||||
Receiving LBRY Credits is considered taxable income in the United States, and may be considered taxable income in your country. If you are a citizen of the United States* and eligible receive over $600 worth of LBC, you will also have to complete tax-related documentation. We will contact you if you are over this threshold.
|
||||
|
||||
Receiving LBRY Credits is considered taxable income in the United States, and may be considered taxable income in your country. If you are a citizen of the United States* and receive over $600 worth of LBC, you will also have to complete tax related documentation. We will contact you if you are over this threshold.
|
||||
|
||||
|
||||
### 3. Promotional Rights
|
||||
LBRY, Inc. has the right to promote your content and its availability on the LBRY network, and to use the name/likeness/voice of your content in its mailing lists, on its website, on the network itself, and through advertising by any and all means.
|
||||
|
||||
### 4. Content Security
|
||||
LBRY, Inc. makes no promises as to the availability or security of your content. While blockchain entries can expire and no longer accessed by our clients, we make no promises or guarantees that we can fully remove your content from the network, nor that we will keep your content secure.
|
||||
|
||||
LBRY, Inc. makes no promises as to the availability or security of your content. While blockchain entries can expire and may no longer be accessed in our clients, we make no promises or guarantees that we can fully remove your content from the network, nor that we will keep your content secure.
|
||||
|
||||
|
||||
|
|
|
@ -3,14 +3,29 @@ title: What is YouTube Sync?
|
|||
category: publisher
|
||||
order: 4
|
||||
---
|
||||
|
||||
**Moving your channel onto LBRY**
|
||||
|
||||
LBRY offers an easy way for YouTubers to sync their content to the LBRY network, engage with LBRY users, and earn LBC.
|
||||
|
||||
To sync your existing channel to LBRY and learn more about the program, use the [LBRY.io YouTube Sync page](https://lbry.io/youtube).
|
||||
|
||||
Authenticating your YouTube channel and other information puts your content into a queue to be automatically mirrored on the LBRY network. This serves as an alternative to moving your entire channel by yourself. The content, its title and description, as well as thumbnails and other metadata, will sync to your channel name. When it is done, you will receive a notice from LBRY indicating your channel is available to view.
|
||||
|
||||
|
||||
When you sync your channel, you are also eligible to receive LBRY Credits in our Partner Program based on your subscriber count. Receiving these credits is subject to a one-year agreement. The exact agreement you make when you sync can be seen [here](https://lbry.io/faq/youtube-terms). The current rewards for syncing can be seen on the [sync page](https://lbry.io/youtube).
|
||||
|
||||
**How to Receive Your LBRY Credits**
|
||||
|
||||
- Download the LBRY App at https://lbry.io/get
|
||||
- Run the LBRY App (this can take a while on your first start up)
|
||||
- Make sure the email saved in the application matches the email address on your [Sync Status Page](https://lbry.io/youtube/status)
|
||||
- Click the Bank icon in the upper righthand corner
|
||||
- Navigate to the Rewards section of your wallet
|
||||
- Scroll to the "YouTube Reward" claim button
|
||||
- If you met a particular subscriber threshold, you should receive the appropriate amount of credits.
|
||||
|
||||
|
||||
If you're having any trouble with the sync process or receiving your credits, please contact [help@lbry.io](mailto:help@lbry.io).
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ In December, we published the [first ever LBRY Development and Community update]
|
|||
|
||||
Please take a moment to read our [Looking Back and Moving Forward: LBRY in 2017/2018](https://lbry.io/news/lbry-in-2017-2018) blog post!
|
||||
|
||||
To skip the tech stuff and see what’s happened and what’s next in the LBRY community, click the link below. Otherwise, read on!
|
||||
To skip the tech stuff, see what’s happened and what’s next in the LBRY community, click the link below. Otherwise, read on!
|
||||
|
||||
[Skip to **Community Happenings**](#com-updates)
|
||||
|
||||
|
@ -16,10 +16,12 @@ To skip the tech stuff and see what’s happened and what’s next in the LBRY c
|
|||
All of our code is open source and available on [GitHub](https://github.com/lbryio). Are you a dev and want to find out more? Check out our [general contributing guide](https://lbry.io/faq/contributing) and our LBRY App specific contributing [document](https://github.com/lbryio/lbry-app/blob/master/CONTRIBUTING.md).
|
||||
|
||||
### App and Protocol Quick Summary
|
||||
As you may know from our previous update, the LBRY App is undergoing a redesign which is taking up a large chunk of the team’s time, but we still managed to ship multiple patch releases to version 0.19 that enabled users to continue enjoying the main functions of the LBRY app. We also finished off January with [version 0.20](https://github.com/lbryio/lbry-app/releases/tag/v0.20.0) which enables a more streamlined LBRY app update process, phone number verification for [LBRY Rewards](https://lbry.io/faq/rewards) that makes it easier for new users to earn some LBC, added automated dark theme mode, patched a security hole introduced by [Electron](https://electronjs.org/blog/protocol-handler-fix) and a bit of code refactoring. On the protocol side, we ran into a showstopper related to how files are handled and were forced to go back to the drawing board to re-engineer a better solution. Our protocol devs also had to deal with growing pains on [spee.ch](https://spee.ch) which continues to uncover invaluable insights into scaling the LBRY as it’s the biggest user of the protocol to date!
|
||||
As you may know from our previous update, the LBRY App is undergoing a redesign which is taking up a large chunk of the team’s time, but we still managed to ship multiple patch releases to version 0.19 that enabled users to continue enjoying the main functions of the LBRY app.
|
||||
|
||||
We also finished off January with [version 0.20](https://github.com/lbryio/lbry-app/releases/tag/v0.20.0) which enables a more streamlined LBRY app update process, phone number verification for [LBRY Rewards](https://lbry.io/faq/rewards) that makes it easier for new users to earn some LBC, added automated dark theme mode, patched a security hole introduced by [Electron](https://electronjs.org/blog/protocol-handler-fix) and a bit of code refactoring. On the protocol side, we ran into a showstopper related to how files are handled and were forced to go back to the drawing board to re-engineer a better solution. Our protocol devs also had to deal with growing pains on [spee.ch](https://spee.ch) which continues to uncover invaluable insights into scaling the LBRY as it’s the biggest user of the protocol to date!
|
||||
|
||||
### Documentation, Organization and Development Processes
|
||||
A considerable amount of effort went into documenting an app side [contributing process](https://github.com/lbryio/lbry-app/blob/master/CONTRIBUTING.md) along with [tagging and organization](https://github.com/lbryio/lbry/wiki/Labels) of GitHub issues which required a careful review off all oustanding issues across multiple repositories. The result was a clearer and more organized depiction of what’s on the plate for our developers to work on but it also provides a more welcoming environment for contributors and potential LBRY developers to get started.
|
||||
A considerable amount of effort went into documenting an app side [contributing process](https://github.com/lbryio/lbry-app/blob/master/CONTRIBUTING.md) along with [tagging and organization](https://github.com/lbryio/lbry/wiki/Labels) of GitHub issues which required a careful review off all outstanding issues across multiple repositories. The result was a clearer and more organized depiction of what’s on the plate for our developers to work on but it also provides a more welcoming environment for contributors and potential LBRY developers to get started.
|
||||
|
||||
During the past month, we’ve also transitioned to a more agile development methodology we like to call [scrum-lite](https://github.com/lbryio/lbry/wiki/Development-Process-&-Standards) which enables the team to reassess and refocus our efforts on a bi-monthly basis. In addition to creating a more structured framework around development processes, this also forces us to break down large tasks into smaller, easier to tackle initiatives which allows for a transition from “I’m still working on it” to “completed part 1A, onto the next one!”.
|
||||
|
||||
|
@ -49,7 +51,7 @@ LBRY wallet encryption has been enabled in the latest versions of the daemon (no
|
|||

|
||||
|
||||
### LBRY Rewards Abuse Defenses
|
||||
Unfortunately, when you try to give away free internet currency, some people will stop at nothing to abuse the system, and as such, we will continue to evolve in order to ramp up defences. We have instituted a new policy that disallows rewards when a VPN/proxy connection is detected and also limit rewards to 1 per household now (previously 1 per person). The 1 LBC email verification reward was removed in a version 19 patch because it was easily abusable. Our wish would be to spend this valuable time on developing the app instead but we also have to be good stewards of LBRY credits that we give out.
|
||||
Unfortunately, when running a rewards program, some people will stop at nothing to abuse the system, and as such, we will continue to evolve in order to ramp up defences. We have instituted a new policy that disallows rewards when a VPN/proxy connection is detected and also limit rewards to 1 per household now (previously 1 per person). The 1 LBC email verification reward was removed in a version 19 patch because it was easily abusable. Our wish would be to spend this valuable time on developing the app instead but we also have to be good stewards of LBRY credits that we give out.
|
||||
|
||||
### New LBRY Rewards Verification Method - SMS
|
||||
In order to provide a more seamless new user experience, version 0.20 of the LBRY app allows users to earn [LBRY rewards](https://lbry.io/faq/rewards) by verifying their phone number over SMS. We will monitor usage and potential abuse over the coming days in order to build a ruleset that minimizes rewards abuse. We also hope that many legitimate users will opt for this method versus our current manual verification which is time consuming for both them and ourselves!
|
||||
|
@ -81,7 +83,7 @@ Last year we had a community member named Adrian, from Poland, reach out to us i
|
|||
Last but not least, we also received interest to collaborate with Avery who is part of the [Arizona State University Blockchain Innovation Society](http://asubis.weebly.com/) - initial talks are underway!
|
||||
|
||||
### Babson College
|
||||
Professor [Steven Gordon](http://www.babson.edu/Academics/faculty/profiles/Pages/gordon-steven.aspx) from Babson College, a business school in Massachusettes, found out about LBRY when researching local blockchain projects and imediately contacted us for more information. He created a new class for this semester on Blockchain technology and will feature LBRY as a case study in the curriculum and one of our team members will be on site to assist!
|
||||
Professor [Steven Gordon](http://www.babson.edu/Academics/faculty/profiles/Pages/gordon-steven.aspx) from Babson College, a business school in Massachusettes, found out about LBRY when researching local blockchain projects and immediately contacted us for more information. He created a new class for this semester on Blockchain technology and will feature LBRY as a case study in the curriculum and one of our team members will be on site to assist!
|
||||
|
||||
### lbry.community Initiatives
|
||||
[lbry.community](https://lbry.community/about/) is a completely independent, community run effort to help spread awareness to the importance of the LBRY protocol. We are thrilled at what they have been able to accomplish to date and are extremely excited that they are able to share a vision for LBRY which takes a unique, user focused approach compared to LBRY’s internal one. Recently, the community website went through a redesign which they promoted alongside various contests which included either visual and written requirements as well as simpler [reddit/Twitter initiatives (you can still enter until Feb 6!)](https://lbry.community/category/open-contests/) . The contest entry period ended with [19 video submissions](https://lbry.community/jan-competition-videos/) and [11 written articles](https://lbry.community/contests/), a truly impressive turnout! Contest voting ends on Feb 6, stay tuned for the results!
|
||||
|
@ -89,3 +91,5 @@ Professor [Steven Gordon](http://www.babson.edu/Academics/faculty/profiles/Pages
|
|||
If you are interested in helping out, please reach out to @rouse on [Discord](https://chat.lbry.io).
|
||||
|
||||
[Back to **Development Updates**](#dev-updates)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
author: brinck-slattery
|
||||
title: 'If you still haven't found what you're searching for...'
|
||||
date: '2018-03-22 15:45:00'
|
||||
cover: 'wooden-letters-banner.jpg'
|
||||
---
|
||||
## Hello LBRYians!
|
||||
|
||||
**LBRY v0.21.2** is live, with some major updates to subscriptions and seriously improved search functionality.
|
||||
|
||||

|
||||
|
||||
A popup explaining how subscriptions work now appears when users first subscribe to a channel, and subscribing will auto-download most recent content as well as any new content posted to the channel.
|
||||
Users will also get a popup notification when a new video is added to a channel they're subscribed to.
|
||||
|
||||
We've upgraded the LBRY Protocol from version 0.18.2 to 0.19.1., which should improve reliability and help download performance and a number of other back-end processes. Get caught up on all changes in the release notes for [0.19.0](https://github.com/lbryio/lbry/releases/tag/v0.19.) and [0.19.1](https://github.com/lbryio/lbry/releases/tag/v0.19.1).
|
||||
|
||||
You can read the [full release notes for v0.21.2 here](https://github.com/lbryio/lbry-app/releases). And if you haven't downloaded the app yet, [what are you waiting for](https://lbry.io/get?auto=1)?
|
|
@ -124,6 +124,7 @@ class Controller
|
|||
$router->post('/youtube/token', 'AcquisitionActions::executeYoutubeToken');
|
||||
$router->any('/youtube/status/{token}', 'AcquisitionActions::executeYoutubeStatus');
|
||||
$router->any('/youtube', 'AcquisitionActions::executeYouTube');
|
||||
$router->any('/youtube/status', 'AcquisitionActions::executeRedirectYoutube');
|
||||
|
||||
$router->get('/verify/{token}', 'AcquisitionActions::executeVerify');
|
||||
|
||||
|
|
|
@ -155,4 +155,8 @@ class Request
|
|||
|
||||
return preg_match('/(' . join('|', $bots) . ')/i', static::getUserAgent());
|
||||
}
|
||||
//Method that encode html tags to special character
|
||||
public static function encodeStringFromUser($string){
|
||||
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,14 @@ class AcquisitionActions extends Actions
|
|||
|
||||
public static function executeYouTube()
|
||||
{
|
||||
return ['acquisition/youtube'];
|
||||
if(isset($_GET['error_message'])){
|
||||
$error_message = Request::encodeStringFromUser($_GET['error_message']);
|
||||
}
|
||||
|
||||
return ['acquisition/youtube', [
|
||||
'reward' => LBRY::youtubeReward(),
|
||||
'error_message' => $error_message ?? ''
|
||||
]];
|
||||
}
|
||||
|
||||
public static function executeVerify(string $token)
|
||||
|
@ -45,7 +52,19 @@ class AcquisitionActions extends Actions
|
|||
|
||||
public static function executeYoutubeStatus(string $token)
|
||||
{
|
||||
return ['acquisition/youtube_status', ['token' => $token]];
|
||||
if(isset($_GET['error_message'])){
|
||||
$error_message = Request::encodeStringFromUser($_GET['error_message']);
|
||||
}
|
||||
|
||||
$data = LBRY::statusYoutube($token);
|
||||
if ($data['success'] == false){
|
||||
Controller::redirect('/youtube?error=true&error_message=' . $data['error']);
|
||||
}
|
||||
return ['acquisition/youtube_status', [
|
||||
'token' => $token,
|
||||
'status_token' => $data,
|
||||
'error_message' => $error_message ?? ''
|
||||
]];
|
||||
}
|
||||
|
||||
public static function actionYoutubeToken(string $desired_lbry_channel_name)
|
||||
|
@ -55,8 +74,6 @@ class AcquisitionActions extends Actions
|
|||
|
||||
if ($desired_lbry_channel_name_is_valid) {
|
||||
$token = LBRY::connectYoutube($desired_lbry_channel_name);
|
||||
var_dump($token);
|
||||
var_dump($desired_lbry_channel_name);
|
||||
if ($token['success'] == false) {
|
||||
Controller::redirect('/youtube?error=true&error_message=' . $token['error']);
|
||||
}
|
||||
|
@ -66,8 +83,9 @@ class AcquisitionActions extends Actions
|
|||
|
||||
}
|
||||
}
|
||||
public static function actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent, $current_value)
|
||||
public static function actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent)
|
||||
{
|
||||
$current_value = LBRY::statusYoutube($status_token);
|
||||
if($current_value['data']['email'] == $email)
|
||||
{
|
||||
$status = LBRY::editYoutube($status_token, $channel_name, null, $sync_consent);
|
||||
|
@ -88,6 +106,10 @@ class AcquisitionActions extends Actions
|
|||
return ['acquisition/youtube_edit'];
|
||||
}
|
||||
|
||||
public static function executeRedirectYoutube(){
|
||||
return ['acquisition/youtube_status_redirect'];
|
||||
}
|
||||
|
||||
protected static function email_verification($email)
|
||||
{
|
||||
if (preg_match('/\S+@\S+\.\S+/', $email)) {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
# age settings are set to English, and the same label renders as "Assista, Compa
|
||||
# rtilhe, Ganhe" if the user's settings are set to Portuguese.
|
||||
#
|
||||
#
|
||||
|
||||
bounty:
|
||||
list:
|
||||
|
@ -20,7 +19,6 @@ description:
|
|||
home: Meet LBRY, a content sharing and publishing platform that is decentralized and owned by its users.
|
||||
join: Follow along and receive updates about LBRY via email.
|
||||
learn: Learn more about LBRY, the technology that puts you back in control of the internet.
|
||||
meetup: LBRY is looking for ambassadors to spread the word to College campuses and Meetup groups worldwide!
|
||||
news: Access information and content in ways you never dreamed possible. Earn credits for your unused bandwidth and diskspace.
|
||||
no-os: Download or install the latest version of LBRY.
|
||||
press: LBRY Press Kit. Information and media for those who want to report on LBRY.
|
||||
|
@ -28,6 +26,7 @@ description:
|
|||
team: LBRY is founded by a team passionate about connecting producers and consumers and breaking down broken models. Learn more about them.
|
||||
test: WHAT WHAT
|
||||
what: Access information and content in ways you never dreamed possible. Earn credits for your unused bandwidth and diskspace.
|
||||
guns: Don't let big tech companies take your rights
|
||||
download:
|
||||
beta: This software is in beta.
|
||||
creator: Creator? Skip the Line
|
||||
|
@ -250,6 +249,7 @@ title:
|
|||
refer: Share and Earn
|
||||
what: "Art in the Internet Age: An Introduction to LBRY"
|
||||
meetup: Have LBRY Join Your Next Meetup!
|
||||
guns: LBRY Fights For Free Speech
|
||||
roadmap:
|
||||
title: LBRY Roadmap
|
||||
description: See past and future progress on development of LBRY, the world's first user-controlled digital marketplace.
|
||||
|
|
2
dev.sh
|
@ -13,4 +13,6 @@ if ! which $PHPBIN 2>/dev/null; then
|
|||
PHPBIN=php
|
||||
fi
|
||||
|
||||
$PHPBIN composer.phar install
|
||||
|
||||
$PHPBIN --server localhost:8000 --docroot "$DIR/web" "$DIR/web/index.php"
|
||||
|
|
|
@ -13,4 +13,5 @@ docker run --rm -it --name "dev.lbry.io" \
|
|||
-p "127.0.0.1:8000:8000" \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
php:7-alpine \
|
||||
php --server "0.0.0.0:8000" --docroot "web/" "web/index.php"
|
||||
php composer.phar install
|
||||
php --server "0.0.0.0:8000" --docroot "web/" "index.php"
|
||||
|
|
1501
lib/vendor/Emogrifier.class.php
vendored
1538
lib/vendor/Parsedown.class.php
vendored
526
lib/vendor/ParsedownExtra.class.php
vendored
|
@ -1,526 +0,0 @@
|
|||
<?php
|
||||
|
||||
#
|
||||
#
|
||||
# Parsedown Extra
|
||||
# https://github.com/erusev/parsedown-extra
|
||||
#
|
||||
# (c) Emanuil Rusev
|
||||
# http://erusev.com
|
||||
#
|
||||
# For the full license information, view the LICENSE file that was distributed
|
||||
# with this source code.
|
||||
#
|
||||
#
|
||||
|
||||
class ParsedownExtra extends Parsedown
|
||||
{
|
||||
# ~
|
||||
|
||||
const version = '0.7.0';
|
||||
|
||||
# ~
|
||||
|
||||
function __construct()
|
||||
{
|
||||
if (parent::version < '1.5.0')
|
||||
{
|
||||
throw new Exception('ParsedownExtra requires a later version of Parsedown');
|
||||
}
|
||||
|
||||
$this->BlockTypes[':'] []= 'DefinitionList';
|
||||
$this->BlockTypes['*'] []= 'Abbreviation';
|
||||
|
||||
# identify footnote definitions before reference definitions
|
||||
array_unshift($this->BlockTypes['['], 'Footnote');
|
||||
|
||||
# identify footnote markers before before links
|
||||
array_unshift($this->InlineTypes['['], 'FootnoteMarker');
|
||||
}
|
||||
|
||||
#
|
||||
# ~
|
||||
|
||||
function text($text)
|
||||
{
|
||||
$markup = parent::text($text);
|
||||
|
||||
# merge consecutive dl elements
|
||||
|
||||
$markup = preg_replace('/<\/dl>\s+<dl>\s+/', '', $markup);
|
||||
|
||||
# add footnotes
|
||||
|
||||
if (isset($this->DefinitionData['Footnote']))
|
||||
{
|
||||
$Element = $this->buildFootnoteElement();
|
||||
|
||||
$markup .= "\n" . $this->element($Element);
|
||||
}
|
||||
|
||||
return $markup;
|
||||
}
|
||||
|
||||
#
|
||||
# Blocks
|
||||
#
|
||||
|
||||
#
|
||||
# Abbreviation
|
||||
|
||||
protected function blockAbbreviation($Line)
|
||||
{
|
||||
if (preg_match('/^\*\[(.+?)\]:[ ]*(.+?)[ ]*$/', $Line['text'], $matches))
|
||||
{
|
||||
$this->DefinitionData['Abbreviation'][$matches[1]] = $matches[2];
|
||||
|
||||
$Block = array(
|
||||
'hidden' => true,
|
||||
);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Footnote
|
||||
|
||||
protected function blockFootnote($Line)
|
||||
{
|
||||
if (preg_match('/^\[\^(.+?)\]:[ ]?(.*)$/', $Line['text'], $matches))
|
||||
{
|
||||
$Block = array(
|
||||
'label' => $matches[1],
|
||||
'text' => $matches[2],
|
||||
'hidden' => true,
|
||||
);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
protected function blockFootnoteContinue($Line, $Block)
|
||||
{
|
||||
if ($Line['text'][0] === '[' and preg_match('/^\[\^(.+?)\]:/', $Line['text']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($Block['interrupted']))
|
||||
{
|
||||
if ($Line['indent'] >= 4)
|
||||
{
|
||||
$Block['text'] .= "\n\n" . $Line['text'];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$Block['text'] .= "\n" . $Line['text'];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
protected function blockFootnoteComplete($Block)
|
||||
{
|
||||
$this->DefinitionData['Footnote'][$Block['label']] = array(
|
||||
'text' => $Block['text'],
|
||||
'count' => null,
|
||||
'number' => null,
|
||||
);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Definition List
|
||||
|
||||
protected function blockDefinitionList($Line, $Block)
|
||||
{
|
||||
if ( ! isset($Block) or isset($Block['type']))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$Element = array(
|
||||
'name' => 'dl',
|
||||
'handler' => 'elements',
|
||||
'text' => array(),
|
||||
);
|
||||
|
||||
$terms = explode("\n", $Block['element']['text']);
|
||||
|
||||
foreach ($terms as $term)
|
||||
{
|
||||
$Element['text'] []= array(
|
||||
'name' => 'dt',
|
||||
'handler' => 'line',
|
||||
'text' => $term,
|
||||
);
|
||||
}
|
||||
|
||||
$Block['element'] = $Element;
|
||||
|
||||
$Block = $this->addDdElement($Line, $Block);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
protected function blockDefinitionListContinue($Line, array $Block)
|
||||
{
|
||||
if ($Line['text'][0] === ':')
|
||||
{
|
||||
$Block = $this->addDdElement($Line, $Block);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($Block['interrupted']) and $Line['indent'] === 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($Block['interrupted']))
|
||||
{
|
||||
$Block['dd']['handler'] = 'text';
|
||||
$Block['dd']['text'] .= "\n\n";
|
||||
|
||||
unset($Block['interrupted']);
|
||||
}
|
||||
|
||||
$text = substr($Line['body'], min($Line['indent'], 4));
|
||||
|
||||
$Block['dd']['text'] .= "\n" . $text;
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Header
|
||||
|
||||
protected function blockHeader($Line)
|
||||
{
|
||||
$Block = parent::blockHeader($Line);
|
||||
|
||||
if (preg_match('/[ #]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
|
||||
{
|
||||
$attributeString = $matches[1][0];
|
||||
|
||||
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
||||
|
||||
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
|
||||
}
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Markup
|
||||
|
||||
protected function blockMarkupComplete($Block)
|
||||
{
|
||||
if ( ! isset($Block['void']))
|
||||
{
|
||||
$Block['markup'] = $this->processTag($Block['markup']);
|
||||
}
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Setext
|
||||
|
||||
protected function blockSetextHeader($Line, array $Block = null)
|
||||
{
|
||||
$Block = parent::blockSetextHeader($Line, $Block);
|
||||
|
||||
if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
|
||||
{
|
||||
$attributeString = $matches[1][0];
|
||||
|
||||
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
|
||||
|
||||
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
|
||||
}
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Inline Elements
|
||||
#
|
||||
|
||||
#
|
||||
# Footnote Marker
|
||||
|
||||
protected function inlineFootnoteMarker($Excerpt)
|
||||
{
|
||||
if (preg_match('/^\[\^(.+?)\]/', $Excerpt['text'], $matches))
|
||||
{
|
||||
$name = $matches[1];
|
||||
|
||||
if ( ! isset($this->DefinitionData['Footnote'][$name]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$this->DefinitionData['Footnote'][$name]['count'] ++;
|
||||
|
||||
if ( ! isset($this->DefinitionData['Footnote'][$name]['number']))
|
||||
{
|
||||
$this->DefinitionData['Footnote'][$name]['number'] = ++ $this->footnoteCount; # » &
|
||||
}
|
||||
|
||||
$Element = array(
|
||||
'name' => 'sup',
|
||||
'attributes' => array('id' => 'fnref'.$this->DefinitionData['Footnote'][$name]['count'].':'.$name),
|
||||
'handler' => 'element',
|
||||
'text' => array(
|
||||
'name' => 'a',
|
||||
'attributes' => array('href' => '#fn:'.$name, 'class' => 'footnote-ref'),
|
||||
'text' => $this->DefinitionData['Footnote'][$name]['number'],
|
||||
),
|
||||
);
|
||||
|
||||
return array(
|
||||
'extent' => strlen($matches[0]),
|
||||
'element' => $Element,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private $footnoteCount = 0;
|
||||
|
||||
#
|
||||
# Link
|
||||
|
||||
protected function inlineLink($Excerpt)
|
||||
{
|
||||
$Link = parent::inlineLink($Excerpt);
|
||||
|
||||
$remainder = substr($Excerpt['text'], $Link['extent']);
|
||||
|
||||
if (preg_match('/^[ ]*{('.$this->regexAttribute.'+)}/', $remainder, $matches))
|
||||
{
|
||||
$Link['element']['attributes'] += $this->parseAttributeData($matches[1]);
|
||||
|
||||
$Link['extent'] += strlen($matches[0]);
|
||||
}
|
||||
|
||||
return $Link;
|
||||
}
|
||||
|
||||
#
|
||||
# ~
|
||||
#
|
||||
|
||||
protected function unmarkedText($text)
|
||||
{
|
||||
$text = parent::unmarkedText($text);
|
||||
|
||||
if (isset($this->DefinitionData['Abbreviation']))
|
||||
{
|
||||
foreach ($this->DefinitionData['Abbreviation'] as $abbreviation => $meaning)
|
||||
{
|
||||
$pattern = '/\b'.preg_quote($abbreviation, '/').'\b/';
|
||||
|
||||
$text = preg_replace($pattern, '<abbr title="'.$meaning.'">'.$abbreviation.'</abbr>', $text);
|
||||
}
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
#
|
||||
# Util Methods
|
||||
#
|
||||
|
||||
protected function addDdElement(array $Line, array $Block)
|
||||
{
|
||||
$text = substr($Line['text'], 1);
|
||||
$text = trim($text);
|
||||
|
||||
unset($Block['dd']);
|
||||
|
||||
$Block['dd'] = array(
|
||||
'name' => 'dd',
|
||||
'handler' => 'line',
|
||||
'text' => $text,
|
||||
);
|
||||
|
||||
if (isset($Block['interrupted']))
|
||||
{
|
||||
$Block['dd']['handler'] = 'text';
|
||||
|
||||
unset($Block['interrupted']);
|
||||
}
|
||||
|
||||
$Block['element']['text'] []= & $Block['dd'];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
||||
protected function buildFootnoteElement()
|
||||
{
|
||||
$Element = array(
|
||||
'name' => 'div',
|
||||
'attributes' => array('class' => 'footnotes'),
|
||||
'handler' => 'elements',
|
||||
'text' => array(
|
||||
array(
|
||||
'name' => 'hr',
|
||||
),
|
||||
array(
|
||||
'name' => 'ol',
|
||||
'handler' => 'elements',
|
||||
'text' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
|
||||
|
||||
foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData)
|
||||
{
|
||||
if ( ! isset($DefinitionData['number']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$text = $DefinitionData['text'];
|
||||
|
||||
$text = parent::text($text);
|
||||
|
||||
$numbers = range(1, $DefinitionData['count']);
|
||||
|
||||
$backLinksMarkup = '';
|
||||
|
||||
foreach ($numbers as $number)
|
||||
{
|
||||
$backLinksMarkup .= ' <a href="#fnref'.$number.':'.$definitionId.'" rev="footnote" class="footnote-backref">↩</a>';
|
||||
}
|
||||
|
||||
$backLinksMarkup = substr($backLinksMarkup, 1);
|
||||
|
||||
if (substr($text, - 4) === '</p>')
|
||||
{
|
||||
$backLinksMarkup = ' '.$backLinksMarkup;
|
||||
|
||||
$text = substr_replace($text, $backLinksMarkup.'</p>', - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "\n".'<p>'.$backLinksMarkup.'</p>';
|
||||
}
|
||||
|
||||
$Element['text'][1]['text'] []= array(
|
||||
'name' => 'li',
|
||||
'attributes' => array('id' => 'fn:'.$definitionId),
|
||||
'text' => "\n".$text."\n",
|
||||
);
|
||||
}
|
||||
|
||||
return $Element;
|
||||
}
|
||||
|
||||
# ~
|
||||
|
||||
protected function parseAttributeData($attributeString)
|
||||
{
|
||||
$Data = array();
|
||||
|
||||
$attributes = preg_split('/[ ]+/', $attributeString, - 1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
foreach ($attributes as $attribute)
|
||||
{
|
||||
if ($attribute[0] === '#')
|
||||
{
|
||||
$Data['id'] = substr($attribute, 1);
|
||||
}
|
||||
else # "."
|
||||
{
|
||||
$classes []= substr($attribute, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($classes))
|
||||
{
|
||||
$Data['class'] = implode(' ', $classes);
|
||||
}
|
||||
|
||||
return $Data;
|
||||
}
|
||||
|
||||
# ~
|
||||
|
||||
protected function processTag($elementMarkup) # recursive
|
||||
{
|
||||
# http://stackoverflow.com/q/1148928/200145
|
||||
libxml_use_internal_errors(true);
|
||||
|
||||
$DOMDocument = new DOMDocument;
|
||||
|
||||
# http://stackoverflow.com/q/11309194/200145
|
||||
$elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');
|
||||
|
||||
# http://stackoverflow.com/q/4879946/200145
|
||||
$DOMDocument->loadHTML($elementMarkup);
|
||||
$DOMDocument->removeChild($DOMDocument->doctype);
|
||||
$DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild);
|
||||
|
||||
$elementText = '';
|
||||
|
||||
if ($DOMDocument->documentElement->getAttribute('markdown') === '1')
|
||||
{
|
||||
foreach ($DOMDocument->documentElement->childNodes as $Node)
|
||||
{
|
||||
$elementText .= $DOMDocument->saveHTML($Node);
|
||||
}
|
||||
|
||||
$DOMDocument->documentElement->removeAttribute('markdown');
|
||||
|
||||
$elementText = "\n".$this->text($elementText)."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($DOMDocument->documentElement->childNodes as $Node)
|
||||
{
|
||||
$nodeMarkup = $DOMDocument->saveHTML($Node);
|
||||
|
||||
if ($Node instanceof DOMElement and ! in_array($Node->nodeName, $this->textLevelElements))
|
||||
{
|
||||
$elementText .= $this->processTag($nodeMarkup);
|
||||
}
|
||||
else
|
||||
{
|
||||
$elementText .= $nodeMarkup;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# because we don't want for markup to get encoded
|
||||
$DOMDocument->documentElement->nodeValue = 'placeholder\x1A';
|
||||
|
||||
$markup = $DOMDocument->saveHTML($DOMDocument->documentElement);
|
||||
$markup = str_replace('placeholder\x1A', $elementText, $markup);
|
||||
|
||||
return $markup;
|
||||
}
|
||||
|
||||
# ~
|
||||
|
||||
protected function sortFootnotes($A, $B) # callback
|
||||
{
|
||||
return $A['number'] - $B['number'];
|
||||
}
|
||||
|
||||
#
|
||||
# Fields
|
||||
#
|
||||
|
||||
protected $regexAttribute = '(?:[#.][-\w]+[ ]*)';
|
||||
}
|
1155
lib/vendor/Spyc.class.php
vendored
47
lib/vendor/scss/Base/Range.class.php
vendored
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Base;
|
||||
|
||||
/**
|
||||
* Range
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Range
|
||||
{
|
||||
public $first;
|
||||
public $last;
|
||||
|
||||
/**
|
||||
* Initialize range
|
||||
*
|
||||
* @param integer|float $first
|
||||
* @param integer|float $last
|
||||
*/
|
||||
public function __construct($first, $last)
|
||||
{
|
||||
$this->first = $first;
|
||||
$this->last = $last;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for inclusion in range
|
||||
*
|
||||
* @param integer|float $value
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function includes($value)
|
||||
{
|
||||
return $value >= $this->first && $value <= $this->last;
|
||||
}
|
||||
}
|
65
lib/vendor/scss/Block.class.php
vendored
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
/**
|
||||
* Block
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Block
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\Block
|
||||
*/
|
||||
public $parent;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $sourceName;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceIndex;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceLine;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceColumn;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $selectors;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $comments;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $children;
|
||||
}
|
179
lib/vendor/scss/Colors.class.php
vendored
|
@ -1,179 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
/**
|
||||
* CSS Colors
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Colors
|
||||
{
|
||||
/**
|
||||
* CSS Colors
|
||||
*
|
||||
* @see http://www.w3.org/TR/css3-color
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $cssColors = [
|
||||
'aliceblue' => '240,248,255',
|
||||
'antiquewhite' => '250,235,215',
|
||||
'aqua' => '0,255,255',
|
||||
'aquamarine' => '127,255,212',
|
||||
'azure' => '240,255,255',
|
||||
'beige' => '245,245,220',
|
||||
'bisque' => '255,228,196',
|
||||
'black' => '0,0,0',
|
||||
'blanchedalmond' => '255,235,205',
|
||||
'blue' => '0,0,255',
|
||||
'blueviolet' => '138,43,226',
|
||||
'brown' => '165,42,42',
|
||||
'burlywood' => '222,184,135',
|
||||
'cadetblue' => '95,158,160',
|
||||
'chartreuse' => '127,255,0',
|
||||
'chocolate' => '210,105,30',
|
||||
'coral' => '255,127,80',
|
||||
'cornflowerblue' => '100,149,237',
|
||||
'cornsilk' => '255,248,220',
|
||||
'crimson' => '220,20,60',
|
||||
'cyan' => '0,255,255',
|
||||
'darkblue' => '0,0,139',
|
||||
'darkcyan' => '0,139,139',
|
||||
'darkgoldenrod' => '184,134,11',
|
||||
'darkgray' => '169,169,169',
|
||||
'darkgreen' => '0,100,0',
|
||||
'darkgrey' => '169,169,169',
|
||||
'darkkhaki' => '189,183,107',
|
||||
'darkmagenta' => '139,0,139',
|
||||
'darkolivegreen' => '85,107,47',
|
||||
'darkorange' => '255,140,0',
|
||||
'darkorchid' => '153,50,204',
|
||||
'darkred' => '139,0,0',
|
||||
'darksalmon' => '233,150,122',
|
||||
'darkseagreen' => '143,188,143',
|
||||
'darkslateblue' => '72,61,139',
|
||||
'darkslategray' => '47,79,79',
|
||||
'darkslategrey' => '47,79,79',
|
||||
'darkturquoise' => '0,206,209',
|
||||
'darkviolet' => '148,0,211',
|
||||
'deeppink' => '255,20,147',
|
||||
'deepskyblue' => '0,191,255',
|
||||
'dimgray' => '105,105,105',
|
||||
'dimgrey' => '105,105,105',
|
||||
'dodgerblue' => '30,144,255',
|
||||
'firebrick' => '178,34,34',
|
||||
'floralwhite' => '255,250,240',
|
||||
'forestgreen' => '34,139,34',
|
||||
'fuchsia' => '255,0,255',
|
||||
'gainsboro' => '220,220,220',
|
||||
'ghostwhite' => '248,248,255',
|
||||
'gold' => '255,215,0',
|
||||
'goldenrod' => '218,165,32',
|
||||
'gray' => '128,128,128',
|
||||
'green' => '0,128,0',
|
||||
'greenyellow' => '173,255,47',
|
||||
'grey' => '128,128,128',
|
||||
'honeydew' => '240,255,240',
|
||||
'hotpink' => '255,105,180',
|
||||
'indianred' => '205,92,92',
|
||||
'indigo' => '75,0,130',
|
||||
'ivory' => '255,255,240',
|
||||
'khaki' => '240,230,140',
|
||||
'lavender' => '230,230,250',
|
||||
'lavenderblush' => '255,240,245',
|
||||
'lawngreen' => '124,252,0',
|
||||
'lemonchiffon' => '255,250,205',
|
||||
'lightblue' => '173,216,230',
|
||||
'lightcoral' => '240,128,128',
|
||||
'lightcyan' => '224,255,255',
|
||||
'lightgoldenrodyellow' => '250,250,210',
|
||||
'lightgray' => '211,211,211',
|
||||
'lightgreen' => '144,238,144',
|
||||
'lightgrey' => '211,211,211',
|
||||
'lightpink' => '255,182,193',
|
||||
'lightsalmon' => '255,160,122',
|
||||
'lightseagreen' => '32,178,170',
|
||||
'lightskyblue' => '135,206,250',
|
||||
'lightslategray' => '119,136,153',
|
||||
'lightslategrey' => '119,136,153',
|
||||
'lightsteelblue' => '176,196,222',
|
||||
'lightyellow' => '255,255,224',
|
||||
'lime' => '0,255,0',
|
||||
'limegreen' => '50,205,50',
|
||||
'linen' => '250,240,230',
|
||||
'magenta' => '255,0,255',
|
||||
'maroon' => '128,0,0',
|
||||
'mediumaquamarine' => '102,205,170',
|
||||
'mediumblue' => '0,0,205',
|
||||
'mediumorchid' => '186,85,211',
|
||||
'mediumpurple' => '147,112,219',
|
||||
'mediumseagreen' => '60,179,113',
|
||||
'mediumslateblue' => '123,104,238',
|
||||
'mediumspringgreen' => '0,250,154',
|
||||
'mediumturquoise' => '72,209,204',
|
||||
'mediumvioletred' => '199,21,133',
|
||||
'midnightblue' => '25,25,112',
|
||||
'mintcream' => '245,255,250',
|
||||
'mistyrose' => '255,228,225',
|
||||
'moccasin' => '255,228,181',
|
||||
'navajowhite' => '255,222,173',
|
||||
'navy' => '0,0,128',
|
||||
'oldlace' => '253,245,230',
|
||||
'olive' => '128,128,0',
|
||||
'olivedrab' => '107,142,35',
|
||||
'orange' => '255,165,0',
|
||||
'orangered' => '255,69,0',
|
||||
'orchid' => '218,112,214',
|
||||
'palegoldenrod' => '238,232,170',
|
||||
'palegreen' => '152,251,152',
|
||||
'paleturquoise' => '175,238,238',
|
||||
'palevioletred' => '219,112,147',
|
||||
'papayawhip' => '255,239,213',
|
||||
'peachpuff' => '255,218,185',
|
||||
'peru' => '205,133,63',
|
||||
'pink' => '255,192,203',
|
||||
'plum' => '221,160,221',
|
||||
'powderblue' => '176,224,230',
|
||||
'purple' => '128,0,128',
|
||||
'rebeccapurple' => '102,51,153',
|
||||
'red' => '255,0,0',
|
||||
'rosybrown' => '188,143,143',
|
||||
'royalblue' => '65,105,225',
|
||||
'saddlebrown' => '139,69,19',
|
||||
'salmon' => '250,128,114',
|
||||
'sandybrown' => '244,164,96',
|
||||
'seagreen' => '46,139,87',
|
||||
'seashell' => '255,245,238',
|
||||
'sienna' => '160,82,45',
|
||||
'silver' => '192,192,192',
|
||||
'skyblue' => '135,206,235',
|
||||
'slateblue' => '106,90,205',
|
||||
'slategray' => '112,128,144',
|
||||
'slategrey' => '112,128,144',
|
||||
'snow' => '255,250,250',
|
||||
'springgreen' => '0,255,127',
|
||||
'steelblue' => '70,130,180',
|
||||
'tan' => '210,180,140',
|
||||
'teal' => '0,128,128',
|
||||
'thistle' => '216,191,216',
|
||||
'tomato' => '255,99,71',
|
||||
'transparent' => '0,0,0,0',
|
||||
'turquoise' => '64,224,208',
|
||||
'violet' => '238,130,238',
|
||||
'wheat' => '245,222,179',
|
||||
'white' => '255,255,255',
|
||||
'whitesmoke' => '245,245,245',
|
||||
'yellow' => '255,255,0',
|
||||
'yellowgreen' => '154,205,50',
|
||||
];
|
||||
}
|
5326
lib/vendor/scss/Compiler.class.php
vendored
40
lib/vendor/scss/Compiler/Environment.class.php
vendored
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Compiler;
|
||||
|
||||
/**
|
||||
* Compiler environment
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Environment
|
||||
{
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\Block
|
||||
*/
|
||||
public $block;
|
||||
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\Compiler\Environment
|
||||
*/
|
||||
public $parent;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $store;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $depth;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Exception;
|
||||
|
||||
/**
|
||||
* Compiler exception
|
||||
*
|
||||
* @author Oleksandr Savchenko <traveltino@gmail.com>
|
||||
*/
|
||||
class CompilerException extends \Exception
|
||||
{
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Exception;
|
||||
|
||||
/**
|
||||
* Parser Exception
|
||||
*
|
||||
* @author Oleksandr Savchenko <traveltino@gmail.com>
|
||||
*/
|
||||
class ParserException extends \Exception
|
||||
{
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Exception;
|
||||
|
||||
/**
|
||||
* Range exception
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class RangeException extends \Exception
|
||||
{
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Exception;
|
||||
|
||||
/**
|
||||
* Server Exception
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class ServerException extends \Exception
|
||||
{
|
||||
}
|
274
lib/vendor/scss/Formatter.class.php
vendored
|
@ -1,274 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
use Leafo\ScssPhp\SourceMap\SourceMapGenerator;
|
||||
|
||||
/**
|
||||
* Base formatter
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
abstract class Formatter
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $indentLevel;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $indentChar;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $break;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $open;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $close;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $tagSeparator;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $assignSeparator;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
public $keepSemicolons;
|
||||
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\Formatter\OutputBlock
|
||||
*/
|
||||
protected $currentBlock;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
protected $currentLine;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
protected $currentColumn;
|
||||
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\SourceMap\SourceMapGenerator
|
||||
*/
|
||||
protected $sourceMapGenerator;
|
||||
|
||||
/**
|
||||
* Initialize formatter
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
abstract public function __construct();
|
||||
|
||||
/**
|
||||
* Return indentation (whitespace)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function indentStr()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property assignment
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function property($name, $value)
|
||||
{
|
||||
return rtrim($name) . $this->assignSeparator . $value . ';';
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip semi-colon appended by property(); it's a separator, not a terminator
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @param array $lines
|
||||
*/
|
||||
public function stripSemicolon(&$lines)
|
||||
{
|
||||
if ($this->keepSemicolons) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (($count = count($lines))
|
||||
&& substr($lines[$count - 1], -1) === ';'
|
||||
) {
|
||||
$lines[$count - 1] = substr($lines[$count - 1], 0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output lines inside a block
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block
|
||||
*/
|
||||
protected function blockLines(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$glue = $this->break . $inner;
|
||||
|
||||
$this->write($inner . implode($glue, $block->lines));
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output block selectors
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block
|
||||
*/
|
||||
protected function blockSelectors(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$this->write($inner
|
||||
. implode($this->tagSeparator, $block->selectors)
|
||||
. $this->open . $this->break);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output block children
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block
|
||||
*/
|
||||
protected function blockChildren(OutputBlock $block)
|
||||
{
|
||||
foreach ($block->children as $child) {
|
||||
$this->block($child);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output non-empty block
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block
|
||||
*/
|
||||
protected function block(OutputBlock $block)
|
||||
{
|
||||
if (empty($block->lines) && empty($block->children)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->currentBlock = $block;
|
||||
|
||||
$pre = $this->indentStr();
|
||||
|
||||
if (! empty($block->selectors)) {
|
||||
$this->blockSelectors($block);
|
||||
|
||||
$this->indentLevel++;
|
||||
}
|
||||
|
||||
if (! empty($block->lines)) {
|
||||
$this->blockLines($block);
|
||||
}
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->blockChildren($block);
|
||||
}
|
||||
|
||||
if (! empty($block->selectors)) {
|
||||
$this->indentLevel--;
|
||||
|
||||
if (empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
|
||||
$this->write($pre . $this->close . $this->break);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point to formatting a block
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block An abstract syntax tree
|
||||
* @param \Leafo\ScssPhp\SourceMap\SourceMapGenerator|null $sourceMapGenerator Optional source map generator
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function format(OutputBlock $block, SourceMapGenerator $sourceMapGenerator = null)
|
||||
{
|
||||
$this->sourceMapGenerator = null;
|
||||
|
||||
if ($sourceMapGenerator) {
|
||||
$this->currentLine = 1;
|
||||
$this->currentColumn = 0;
|
||||
$this->sourceMapGenerator = $sourceMapGenerator;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
$this->block($block);
|
||||
|
||||
$out = ob_get_clean();
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
*/
|
||||
protected function write($str)
|
||||
{
|
||||
if ($this->sourceMapGenerator) {
|
||||
$this->sourceMapGenerator->addMapping(
|
||||
$this->currentLine,
|
||||
$this->currentColumn,
|
||||
$this->currentBlock->sourceLine,
|
||||
$this->currentBlock->sourceColumn - 1, //columns from parser are off by one
|
||||
$this->currentBlock->sourceName
|
||||
);
|
||||
|
||||
$lines = explode("\n", $str);
|
||||
$lineCount = count($lines);
|
||||
$this->currentLine += $lineCount-1;
|
||||
|
||||
$lastLine = array_pop($lines);
|
||||
|
||||
$this->currentColumn = ($lineCount === 1 ? $this->currentColumn : 0) + strlen($lastLine);
|
||||
}
|
||||
|
||||
echo $str;
|
||||
}
|
||||
}
|
45
lib/vendor/scss/Formatter/Compact.class.php
vendored
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
|
||||
/**
|
||||
* Compact formatter
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Compact extends Formatter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = '';
|
||||
$this->break = '';
|
||||
$this->open = ' {';
|
||||
$this->close = "}\n\n";
|
||||
$this->tagSeparator = ',';
|
||||
$this->assignSeparator = ':';
|
||||
$this->keepSemicolons = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function indentStr()
|
||||
{
|
||||
return ' ';
|
||||
}
|
||||
}
|
62
lib/vendor/scss/Formatter/Compressed.class.php
vendored
|
@ -1,62 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
|
||||
/**
|
||||
* Compressed formatter
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Compressed extends Formatter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = ' ';
|
||||
$this->break = '';
|
||||
$this->open = '{';
|
||||
$this->close = '}';
|
||||
$this->tagSeparator = ',';
|
||||
$this->assignSeparator = ':';
|
||||
$this->keepSemicolons = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function blockLines(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$glue = $this->break . $inner;
|
||||
|
||||
foreach ($block->lines as $index => $line) {
|
||||
if (substr($line, 0, 2) === '/*' && substr($line, 2, 1) !== '!') {
|
||||
unset($block->lines[$index]);
|
||||
} elseif (substr($line, 0, 3) === '/*!') {
|
||||
$block->lines[$index] = '/*' . substr($line, 3);
|
||||
}
|
||||
}
|
||||
|
||||
$this->write($inner . implode($glue, $block->lines));
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
}
|
60
lib/vendor/scss/Formatter/Crunched.class.php
vendored
|
@ -1,60 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
|
||||
/**
|
||||
* Crunched formatter
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Crunched extends Formatter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = ' ';
|
||||
$this->break = '';
|
||||
$this->open = '{';
|
||||
$this->close = '}';
|
||||
$this->tagSeparator = ',';
|
||||
$this->assignSeparator = ':';
|
||||
$this->keepSemicolons = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function blockLines(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$glue = $this->break . $inner;
|
||||
|
||||
foreach ($block->lines as $index => $line) {
|
||||
if (substr($line, 0, 2) === '/*') {
|
||||
unset($block->lines[$index]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->write($inner . implode($glue, $block->lines));
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
}
|
121
lib/vendor/scss/Formatter/Debug.class.php
vendored
|
@ -1,121 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
|
||||
/**
|
||||
* Debug formatter
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Debug extends Formatter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = '';
|
||||
$this->break = "\n";
|
||||
$this->open = ' {';
|
||||
$this->close = ' }';
|
||||
$this->tagSeparator = ', ';
|
||||
$this->assignSeparator = ': ';
|
||||
$this->keepSemicolons = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function indentStr()
|
||||
{
|
||||
return str_repeat(' ', $this->indentLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockLines(OutputBlock $block)
|
||||
{
|
||||
$indent = $this->indentStr();
|
||||
|
||||
if (empty($block->lines)) {
|
||||
$this->write("{$indent}block->lines: []\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($block->lines as $index => $line) {
|
||||
$this->write("{$indent}block->lines[{$index}]: $line\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockSelectors(OutputBlock $block)
|
||||
{
|
||||
$indent = $this->indentStr();
|
||||
|
||||
if (empty($block->selectors)) {
|
||||
$this->write("{$indent}block->selectors: []\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($block->selectors as $index => $selector) {
|
||||
$this->write("{$indent}block->selectors[{$index}]: $selector\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockChildren(OutputBlock $block)
|
||||
{
|
||||
$indent = $this->indentStr();
|
||||
|
||||
if (empty($block->children)) {
|
||||
$this->write("{$indent}block->children: []\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->indentLevel++;
|
||||
|
||||
foreach ($block->children as $i => $child) {
|
||||
$this->block($child);
|
||||
}
|
||||
|
||||
$this->indentLevel--;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function block(OutputBlock $block)
|
||||
{
|
||||
$indent = $this->indentStr();
|
||||
|
||||
$this->write("{$indent}block->type: {$block->type}\n" .
|
||||
"{$indent}block->depth: {$block->depth}\n");
|
||||
|
||||
$this->currentBlock = $block;
|
||||
|
||||
$this->blockSelectors($block);
|
||||
$this->blockLines($block);
|
||||
$this->blockChildren($block);
|
||||
}
|
||||
}
|
68
lib/vendor/scss/Formatter/Expanded.class.php
vendored
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
|
||||
/**
|
||||
* Expanded formatter
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Expanded extends Formatter
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = ' ';
|
||||
$this->break = "\n";
|
||||
$this->open = ' {';
|
||||
$this->close = '}';
|
||||
$this->tagSeparator = ', ';
|
||||
$this->assignSeparator = ': ';
|
||||
$this->keepSemicolons = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function indentStr()
|
||||
{
|
||||
return str_repeat($this->indentChar, $this->indentLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockLines(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$glue = $this->break . $inner;
|
||||
|
||||
foreach ($block->lines as $index => $line) {
|
||||
if (substr($line, 0, 2) === '/*') {
|
||||
$block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line);
|
||||
}
|
||||
}
|
||||
|
||||
$this->write($inner . implode($glue, $block->lines));
|
||||
|
||||
if (empty($block->selectors) || ! empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
}
|
201
lib/vendor/scss/Formatter/Nested.class.php
vendored
|
@ -1,201 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
use Leafo\ScssPhp\Formatter;
|
||||
use Leafo\ScssPhp\Formatter\OutputBlock;
|
||||
|
||||
/**
|
||||
* Nested formatter
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Nested extends Formatter
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
private $depth;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->indentLevel = 0;
|
||||
$this->indentChar = ' ';
|
||||
$this->break = "\n";
|
||||
$this->open = ' {';
|
||||
$this->close = ' }';
|
||||
$this->tagSeparator = ', ';
|
||||
$this->assignSeparator = ': ';
|
||||
$this->keepSemicolons = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function indentStr()
|
||||
{
|
||||
$n = $this->depth - 1;
|
||||
|
||||
return str_repeat($this->indentChar, max($this->indentLevel + $n, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockLines(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$glue = $this->break . $inner;
|
||||
|
||||
foreach ($block->lines as $index => $line) {
|
||||
if (substr($line, 0, 2) === '/*') {
|
||||
$block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line);
|
||||
}
|
||||
}
|
||||
|
||||
$this->write($inner . implode($glue, $block->lines));
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockSelectors(OutputBlock $block)
|
||||
{
|
||||
$inner = $this->indentStr();
|
||||
|
||||
$this->write($inner
|
||||
. implode($this->tagSeparator, $block->selectors)
|
||||
. $this->open . $this->break);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function blockChildren(OutputBlock $block)
|
||||
{
|
||||
foreach ($block->children as $i => $child) {
|
||||
$this->block($child);
|
||||
|
||||
if ($i < count($block->children) - 1) {
|
||||
$this->write($this->break);
|
||||
|
||||
if (isset($block->children[$i + 1])) {
|
||||
$next = $block->children[$i + 1];
|
||||
|
||||
if ($next->depth === max($block->depth, 1) && $child->depth >= $next->depth) {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function block(OutputBlock $block)
|
||||
{
|
||||
if ($block->type === 'root') {
|
||||
$this->adjustAllChildren($block);
|
||||
}
|
||||
|
||||
if (empty($block->lines) && empty($block->children)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->currentBlock = $block;
|
||||
|
||||
|
||||
$this->depth = $block->depth;
|
||||
|
||||
if (! empty($block->selectors)) {
|
||||
$this->blockSelectors($block);
|
||||
|
||||
$this->indentLevel++;
|
||||
}
|
||||
|
||||
if (! empty($block->lines)) {
|
||||
$this->blockLines($block);
|
||||
}
|
||||
|
||||
if (! empty($block->children)) {
|
||||
$this->blockChildren($block);
|
||||
}
|
||||
|
||||
if (! empty($block->selectors)) {
|
||||
$this->indentLevel--;
|
||||
|
||||
$this->write($this->close);
|
||||
}
|
||||
|
||||
if ($block->type === 'root') {
|
||||
$this->write($this->break);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust the depths of all children, depth first
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Formatter\OutputBlock $block
|
||||
*/
|
||||
private function adjustAllChildren(OutputBlock $block)
|
||||
{
|
||||
// flatten empty nested blocks
|
||||
$children = [];
|
||||
|
||||
foreach ($block->children as $i => $child) {
|
||||
if (empty($child->lines) && empty($child->children)) {
|
||||
if (isset($block->children[$i + 1])) {
|
||||
$block->children[$i + 1]->depth = $child->depth;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$children[] = $child;
|
||||
}
|
||||
|
||||
$count = count($children);
|
||||
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$depth = $children[$i]->depth;
|
||||
$j = $i + 1;
|
||||
|
||||
if (isset($children[$j]) && $depth < $children[$j]->depth) {
|
||||
$childDepth = $children[$j]->depth;
|
||||
|
||||
for (; $j < $count; $j++) {
|
||||
if ($depth < $children[$j]->depth && $childDepth >= $children[$j]->depth) {
|
||||
$children[$j]->depth = $depth + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$block->children = $children;
|
||||
|
||||
// make relative to parent
|
||||
foreach ($block->children as $child) {
|
||||
$this->adjustAllChildren($child);
|
||||
|
||||
$child->depth = $child->depth - $block->depth;
|
||||
}
|
||||
}
|
||||
}
|
65
lib/vendor/scss/Formatter/OutputBlock.class.php
vendored
|
@ -1,65 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Formatter;
|
||||
|
||||
/**
|
||||
* Output block
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class OutputBlock
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $depth;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $selectors;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $lines;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $children;
|
||||
|
||||
/**
|
||||
* @var \Leafo\ScssPhp\Formatter\OutputBlock
|
||||
*/
|
||||
public $parent;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $sourceName;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceLine;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceColumn;
|
||||
}
|
40
lib/vendor/scss/Node.class.php
vendored
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
/**
|
||||
* Base node
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
abstract class Node
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceIndex;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceLine;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
public $sourceColumn;
|
||||
}
|
330
lib/vendor/scss/Node/Number.class.php
vendored
|
@ -1,330 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\Node;
|
||||
|
||||
use Leafo\ScssPhp\Compiler;
|
||||
use Leafo\ScssPhp\Node;
|
||||
use Leafo\ScssPhp\Type;
|
||||
|
||||
/**
|
||||
* Dimension + optional units
|
||||
*
|
||||
* {@internal
|
||||
* This is a work-in-progress.
|
||||
*
|
||||
* The \ArrayAccess interface is temporary until the migration is complete.
|
||||
* }}
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Number extends Node implements \ArrayAccess
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
static public $precision = 10;
|
||||
|
||||
/**
|
||||
* @see http://www.w3.org/TR/2012/WD-css3-values-20120308/
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
static protected $unitTable = [
|
||||
'in' => [
|
||||
'in' => 1,
|
||||
'pc' => 6,
|
||||
'pt' => 72,
|
||||
'px' => 96,
|
||||
'cm' => 2.54,
|
||||
'mm' => 25.4,
|
||||
'q' => 101.6,
|
||||
],
|
||||
'turn' => [
|
||||
'deg' => 360,
|
||||
'grad' => 400,
|
||||
'rad' => 6.28318530717958647692528676, // 2 * M_PI
|
||||
'turn' => 1,
|
||||
],
|
||||
's' => [
|
||||
's' => 1,
|
||||
'ms' => 1000,
|
||||
],
|
||||
'Hz' => [
|
||||
'Hz' => 1,
|
||||
'kHz' => 0.001,
|
||||
],
|
||||
'dpi' => [
|
||||
'dpi' => 1,
|
||||
'dpcm' => 2.54,
|
||||
'dppx' => 96,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @var integer|float
|
||||
*/
|
||||
public $dimension;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $units;
|
||||
|
||||
/**
|
||||
* Initialize number
|
||||
*
|
||||
* @param mixed $dimension
|
||||
* @param mixed $initialUnit
|
||||
*/
|
||||
public function __construct($dimension, $initialUnit)
|
||||
{
|
||||
$this->type = Type::T_NUMBER;
|
||||
$this->dimension = $dimension;
|
||||
$this->units = is_array($initialUnit)
|
||||
? $initialUnit
|
||||
: ($initialUnit ? [$initialUnit => 1]
|
||||
: []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce number to target units
|
||||
*
|
||||
* @param array $units
|
||||
*
|
||||
* @return \Leafo\ScssPhp\Node\Number
|
||||
*/
|
||||
public function coerce($units)
|
||||
{
|
||||
if ($this->unitless()) {
|
||||
return new Number($this->dimension, $units);
|
||||
}
|
||||
|
||||
$dimension = $this->dimension;
|
||||
|
||||
foreach (static::$unitTable['in'] as $unit => $conv) {
|
||||
$from = isset($this->units[$unit]) ? $this->units[$unit] : 0;
|
||||
$to = isset($units[$unit]) ? $units[$unit] : 0;
|
||||
$factor = pow($conv, $from - $to);
|
||||
$dimension /= $factor;
|
||||
}
|
||||
|
||||
return new Number($dimension, $units);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize number
|
||||
*
|
||||
* @return \Leafo\ScssPhp\Node\Number
|
||||
*/
|
||||
public function normalize()
|
||||
{
|
||||
$dimension = $this->dimension;
|
||||
$units = [];
|
||||
|
||||
$this->normalizeUnits($dimension, $units, 'in');
|
||||
|
||||
return new Number($dimension, $units);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
if ($offset === -3) {
|
||||
return $this->sourceColumn !== null;
|
||||
}
|
||||
|
||||
if ($offset === -2) {
|
||||
return $this->sourceLine !== null;
|
||||
}
|
||||
|
||||
if ($offset === -1
|
||||
|| $offset === 0
|
||||
|| $offset === 1
|
||||
|| $offset === 2
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
switch ($offset) {
|
||||
case -3:
|
||||
return $this->sourceColumn;
|
||||
|
||||
case -2:
|
||||
return $this->sourceLine;
|
||||
|
||||
case -1:
|
||||
return $this->sourceIndex;
|
||||
|
||||
case 0:
|
||||
return $this->type;
|
||||
|
||||
case 1:
|
||||
return $this->dimension;
|
||||
|
||||
case 2:
|
||||
return $this->units;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if ($offset === 1) {
|
||||
$this->dimension = $value;
|
||||
} elseif ($offset === 2) {
|
||||
$this->units = $value;
|
||||
} elseif ($offset == -1) {
|
||||
$this->sourceIndex = $value;
|
||||
} elseif ($offset == -2) {
|
||||
$this->sourceLine = $value;
|
||||
} elseif ($offset == -3) {
|
||||
$this->sourceColumn = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
if ($offset === 1) {
|
||||
$this->dimension = null;
|
||||
} elseif ($offset === 2) {
|
||||
$this->units = null;
|
||||
} elseif ($offset === -1) {
|
||||
$this->sourceIndex = null;
|
||||
} elseif ($offset === -2) {
|
||||
$this->sourceLine = null;
|
||||
} elseif ($offset === -3) {
|
||||
$this->sourceColumn = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the number is unitless
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function unitless()
|
||||
{
|
||||
return ! array_sum($this->units);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns unit(s) as the product of numerator units divided by the product of denominator units
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function unitStr()
|
||||
{
|
||||
$numerators = [];
|
||||
$denominators = [];
|
||||
|
||||
foreach ($this->units as $unit => $unitSize) {
|
||||
if ($unitSize > 0) {
|
||||
$numerators = array_pad($numerators, count($numerators) + $unitSize, $unit);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($unitSize < 0) {
|
||||
$denominators = array_pad($denominators, count($denominators) + $unitSize, $unit);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return implode('*', $numerators) . (count($denominators) ? '/' . implode('*', $denominators) : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Output number
|
||||
*
|
||||
* @param \Leafo\ScssPhp\Compiler $compiler
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function output(Compiler $compiler = null)
|
||||
{
|
||||
$dimension = round($this->dimension, static::$precision);
|
||||
|
||||
$units = array_filter($this->units, function ($unitSize) {
|
||||
return $unitSize;
|
||||
});
|
||||
|
||||
if (count($units) > 1 && array_sum($units) === 0) {
|
||||
$dimension = $this->dimension;
|
||||
$units = [];
|
||||
|
||||
$this->normalizeUnits($dimension, $units, 'in');
|
||||
|
||||
$dimension = round($dimension, static::$precision);
|
||||
$units = array_filter($units, function ($unitSize) {
|
||||
return $unitSize;
|
||||
});
|
||||
}
|
||||
|
||||
$unitSize = array_sum($units);
|
||||
|
||||
if ($compiler && ($unitSize > 1 || $unitSize < 0 || count($units) > 1)) {
|
||||
$compiler->throwError((string) $dimension . $this->unitStr() . " isn't a valid CSS value.");
|
||||
}
|
||||
|
||||
reset($units);
|
||||
$unit = key($units);
|
||||
$dimension = number_format($dimension, static::$precision, '.', '');
|
||||
|
||||
return (static::$precision ? rtrim(rtrim($dimension, '0'), '.') : $dimension) . $unit;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->output();
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize units
|
||||
*
|
||||
* @param integer|float $dimension
|
||||
* @param array $units
|
||||
* @param string $baseUnit
|
||||
*/
|
||||
private function normalizeUnits(&$dimension, &$units, $baseUnit = 'in')
|
||||
{
|
||||
$dimension = $this->dimension;
|
||||
$units = [];
|
||||
|
||||
foreach ($this->units as $unit => $exp) {
|
||||
if (isset(static::$unitTable[$baseUnit][$unit])) {
|
||||
$factor = pow(static::$unitTable[$baseUnit][$unit], $exp);
|
||||
|
||||
$unit = $baseUnit;
|
||||
$dimension /= $factor;
|
||||
}
|
||||
|
||||
$units[$unit] = $exp + (isset($units[$unit]) ? $units[$unit] : 0);
|
||||
}
|
||||
}
|
||||
}
|
2494
lib/vendor/scss/Parser.class.php
vendored
217
lib/vendor/scss/SourceMap/Base64VLQEncoder.class.php
vendored
|
@ -1,217 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\SourceMap;
|
||||
|
||||
/**
|
||||
* Base64 VLQ Encoder
|
||||
*
|
||||
* {@internal Derivative of oyejorge/less.php's lib/SourceMap/Base64VLQ.php, relicensed with permission. }}
|
||||
*
|
||||
* @author Josh Schmidt <oyejorge@gmail.com>
|
||||
* @author Nicolas FRANÇOIS <nicolas.francois@frog-labs.com>
|
||||
*/
|
||||
class Base64VLQEncoder
|
||||
{
|
||||
/**
|
||||
* Shift
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $shift = 5;
|
||||
|
||||
/**
|
||||
* Mask
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $mask = 0x1F; // == (1 << shift) == 0b00011111
|
||||
|
||||
/**
|
||||
* Continuation bit
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $continuationBit = 0x20; // == (mask - 1 ) == 0b00100000
|
||||
|
||||
/**
|
||||
* Char to integer map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $charToIntMap = array(
|
||||
'A' => 0, 'B' => 1, 'C' => 2, 'D' => 3, 'E' => 4, 'F' => 5, 'G' => 6, 'H' => 7,
|
||||
'I' => 8, 'J' => 9, 'K' => 10, 'L' => 11, 'M' => 12, 'N' => 13, 'O' => 14, 'P' => 15,
|
||||
'Q' => 16, 'R' => 17, 'S' => 18, 'T' => 19, 'U' => 20, 'V' => 21, 'W' => 22, 'X' => 23,
|
||||
'Y' => 24, 'Z' => 25, 'a' => 26, 'b' => 27, 'c' => 28, 'd' => 29, 'e' => 30, 'f' => 31,
|
||||
'g' => 32, 'h' => 33, 'i' => 34, 'j' => 35, 'k' => 36, 'l' => 37, 'm' => 38, 'n' => 39,
|
||||
'o' => 40, 'p' => 41, 'q' => 42, 'r' => 43, 's' => 44, 't' => 45, 'u' => 46, 'v' => 47,
|
||||
'w' => 48, 'x' => 49, 'y' => 50, 'z' => 51, 0 => 52, 1 => 53, 2 => 54, 3 => 55,
|
||||
4 => 56, 5 => 57, 6 => 58, 7 => 59, 8 => 60, 9 => 61, '+' => 62, '/' => 63,
|
||||
);
|
||||
|
||||
/**
|
||||
* Integer to char map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $intToCharMap = array(
|
||||
0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D', 4 => 'E', 5 => 'F', 6 => 'G', 7 => 'H',
|
||||
8 => 'I', 9 => 'J', 10 => 'K', 11 => 'L', 12 => 'M', 13 => 'N', 14 => 'O', 15 => 'P',
|
||||
16 => 'Q', 17 => 'R', 18 => 'S', 19 => 'T', 20 => 'U', 21 => 'V', 22 => 'W', 23 => 'X',
|
||||
24 => 'Y', 25 => 'Z', 26 => 'a', 27 => 'b', 28 => 'c', 29 => 'd', 30 => 'e', 31 => 'f',
|
||||
32 => 'g', 33 => 'h', 34 => 'i', 35 => 'j', 36 => 'k', 37 => 'l', 38 => 'm', 39 => 'n',
|
||||
40 => 'o', 41 => 'p', 42 => 'q', 43 => 'r', 44 => 's', 45 => 't', 46 => 'u', 47 => 'v',
|
||||
48 => 'w', 49 => 'x', 50 => 'y', 51 => 'z', 52 => '0', 53 => '1', 54 => '2', 55 => '3',
|
||||
56 => '4', 57 => '5', 58 => '6', 59 => '7', 60 => '8', 61 => '9', 62 => '+', 63 => '/',
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// I leave it here for future reference
|
||||
// foreach (str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/') as $i => $char)
|
||||
// {
|
||||
// $this->charToIntMap[$char] = $i;
|
||||
// $this->intToCharMap[$i] = $char;
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from a two-complement value to a value where the sign bit is
|
||||
* is placed in the least significant bit. For example, as decimals:
|
||||
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
||||
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
||||
* We generate the value for 32 bit machines, hence -2147483648 becomes 1, not 4294967297,
|
||||
* even on a 64 bit machine.
|
||||
*
|
||||
* @param string $aValue
|
||||
*/
|
||||
public function toVLQSigned($aValue)
|
||||
{
|
||||
return 0xffffffff & ($aValue < 0 ? ((-$aValue) << 1) + 1 : ($aValue << 1) + 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to a two-complement value from a value where the sign bit is
|
||||
* is placed in the least significant bit. For example, as decimals:
|
||||
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
||||
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
||||
* We assume that the value was generated with a 32 bit machine in mind.
|
||||
* Hence
|
||||
* 1 becomes -2147483648
|
||||
* even on a 64 bit machine.
|
||||
*
|
||||
* @param integer $aValue
|
||||
*/
|
||||
public function fromVLQSigned($aValue)
|
||||
{
|
||||
return $aValue & 1 ? $this->zeroFill(~$aValue + 2, 1) | (-1 - 0x7fffffff) : $this->zeroFill($aValue, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the base 64 VLQ encoded value.
|
||||
*
|
||||
* @param string $aValue The value to encode
|
||||
*
|
||||
* @return string The encoded value
|
||||
*/
|
||||
public function encode($aValue)
|
||||
{
|
||||
$encoded = '';
|
||||
$vlq = $this->toVLQSigned($aValue);
|
||||
|
||||
do {
|
||||
$digit = $vlq & $this->mask;
|
||||
$vlq = $this->zeroFill($vlq, $this->shift);
|
||||
|
||||
if ($vlq > 0) {
|
||||
$digit |= $this->continuationBit;
|
||||
}
|
||||
|
||||
$encoded .= $this->base64Encode($digit);
|
||||
} while ($vlq > 0);
|
||||
|
||||
return $encoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value decoded from base 64 VLQ.
|
||||
*
|
||||
* @param string $encoded The encoded value to decode
|
||||
*
|
||||
* @return integer The decoded value
|
||||
*/
|
||||
public function decode($encoded)
|
||||
{
|
||||
$vlq = 0;
|
||||
$i = 0;
|
||||
|
||||
do {
|
||||
$digit = $this->base64Decode($encoded[$i]);
|
||||
$vlq |= ($digit & $this->mask) << ($i * $this->shift);
|
||||
$i++;
|
||||
} while ($digit & $this->continuationBit);
|
||||
|
||||
return $this->fromVLQSigned($vlq);
|
||||
}
|
||||
|
||||
/**
|
||||
* Right shift with zero fill.
|
||||
*
|
||||
* @param integer $a number to shift
|
||||
* @param integer $b number of bits to shift
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function zeroFill($a, $b)
|
||||
{
|
||||
return ($a >= 0) ? ($a >> $b) : ($a >> $b) & (PHP_INT_MAX >> ($b - 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode single 6-bit digit as base64.
|
||||
*
|
||||
* @param integer $number
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \Exception If the number is invalid
|
||||
*/
|
||||
public function base64Encode($number)
|
||||
{
|
||||
if ($number < 0 || $number > 63) {
|
||||
throw new \Exception(sprintf('Invalid number "%s" given. Must be between 0 and 63.', $number));
|
||||
}
|
||||
|
||||
return $this->intToCharMap[$number];
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode single 6-bit digit from base64
|
||||
*
|
||||
* @param string $char
|
||||
*
|
||||
* @return integer
|
||||
*
|
||||
* @throws \Exception If the number is invalid
|
||||
*/
|
||||
public function base64Decode($char)
|
||||
{
|
||||
if (! array_key_exists($char, $this->charToIntMap)) {
|
||||
throw new \Exception(sprintf('Invalid base 64 digit "%s" given.', $char));
|
||||
}
|
||||
|
||||
return $this->charToIntMap[$char];
|
||||
}
|
||||
}
|
|
@ -1,337 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp\SourceMap;
|
||||
|
||||
use Leafo\ScssPhp\Exception\CompilerException;
|
||||
|
||||
/**
|
||||
* Source Map Generator
|
||||
*
|
||||
* {@internal Derivative of oyejorge/less.php's lib/SourceMap/Generator.php, relicensed with permission. }}
|
||||
*
|
||||
* @author Josh Schmidt <oyejorge@gmail.com>
|
||||
* @author Nicolas FRANÇOIS <nicolas.francois@frog-labs.com>
|
||||
*/
|
||||
class SourceMapGenerator
|
||||
{
|
||||
/**
|
||||
* What version of source map does the generator generate?
|
||||
*/
|
||||
const VERSION = 3;
|
||||
|
||||
/**
|
||||
* Array of default options
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $defaultOptions = array(
|
||||
// an optional source root, useful for relocating source files
|
||||
// on a server or removing repeated values in the 'sources' entry.
|
||||
// This value is prepended to the individual entries in the 'source' field.
|
||||
'sourceRoot' => '',
|
||||
|
||||
// an optional name of the generated code that this source map is associated with.
|
||||
'sourceMapFilename' => null,
|
||||
|
||||
// url of the map
|
||||
'sourceMapURL' => null,
|
||||
|
||||
// absolute path to a file to write the map to
|
||||
'sourceMapWriteTo' => null,
|
||||
|
||||
// output source contents?
|
||||
'outputSourceFiles' => false,
|
||||
|
||||
// base path for filename normalization
|
||||
'sourceMapRootpath' => '',
|
||||
|
||||
// base path for filename normalization
|
||||
'sourceMapBasepath' => ''
|
||||
);
|
||||
|
||||
/**
|
||||
* The base64 VLQ encoder
|
||||
*
|
||||
* @var \Leafo\ScssPhp\SourceMap\Base64VLQEncoder
|
||||
*/
|
||||
protected $encoder;
|
||||
|
||||
/**
|
||||
* Array of mappings
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $mappings = array();
|
||||
|
||||
/**
|
||||
* Array of contents map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $contentsMap = array();
|
||||
|
||||
/**
|
||||
* File to content map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $sources = array();
|
||||
protected $source_keys = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $options;
|
||||
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
$this->options = array_merge($this->defaultOptions, $options);
|
||||
$this->encoder = new Base64VLQEncoder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a mapping
|
||||
*
|
||||
* @param integer $generatedLine The line number in generated file
|
||||
* @param integer $generatedColumn The column number in generated file
|
||||
* @param integer $originalLine The line number in original file
|
||||
* @param integer $originalColumn The column number in original file
|
||||
* @param string $sourceFile The original source file
|
||||
*/
|
||||
public function addMapping($generatedLine, $generatedColumn, $originalLine, $originalColumn, $sourceFile)
|
||||
{
|
||||
$this->mappings[] = array(
|
||||
'generated_line' => $generatedLine,
|
||||
'generated_column' => $generatedColumn,
|
||||
'original_line' => $originalLine,
|
||||
'original_column' => $originalColumn,
|
||||
'source_file' => $sourceFile
|
||||
);
|
||||
|
||||
$this->sources[$sourceFile] = $sourceFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the source map to a file
|
||||
*
|
||||
* @param string $file The absolute path to a file
|
||||
* @param string $content The content to write
|
||||
*
|
||||
* @throws \Leafo\ScssPhp\Exception\CompilerException If the file could not be saved
|
||||
*/
|
||||
public function saveMap($content)
|
||||
{
|
||||
$file = $this->options['sourceMapWriteTo'];
|
||||
$dir = dirname($file);
|
||||
|
||||
// directory does not exist
|
||||
if (! is_dir($dir)) {
|
||||
// FIXME: create the dir automatically?
|
||||
throw new CompilerException(sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir));
|
||||
}
|
||||
|
||||
// FIXME: proper saving, with dir write check!
|
||||
if (file_put_contents($file, $content) === false) {
|
||||
throw new CompilerException(sprintf('Cannot save the source map to "%s"', $file));
|
||||
}
|
||||
|
||||
return $this->options['sourceMapURL'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the JSON source map
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @see https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#
|
||||
*/
|
||||
public function generateJson()
|
||||
{
|
||||
$sourceMap = array();
|
||||
$mappings = $this->generateMappings();
|
||||
|
||||
// File version (always the first entry in the object) and must be a positive integer.
|
||||
$sourceMap['version'] = self::VERSION;
|
||||
|
||||
// An optional name of the generated code that this source map is associated with.
|
||||
$file = $this->options['sourceMapFilename'];
|
||||
|
||||
if ($file) {
|
||||
$sourceMap['file'] = $file;
|
||||
}
|
||||
|
||||
// An optional source root, useful for relocating source files on a server or removing repeated values in the
|
||||
// 'sources' entry. This value is prepended to the individual entries in the 'source' field.
|
||||
$root = $this->options['sourceRoot'];
|
||||
|
||||
if ($root) {
|
||||
$sourceMap['sourceRoot'] = $root;
|
||||
}
|
||||
|
||||
// A list of original sources used by the 'mappings' entry.
|
||||
$sourceMap['sources'] = array();
|
||||
|
||||
foreach ($this->sources as $source_uri => $source_filename) {
|
||||
$sourceMap['sources'][] = $this->normalizeFilename($source_filename);
|
||||
}
|
||||
|
||||
// A list of symbol names used by the 'mappings' entry.
|
||||
$sourceMap['names'] = array();
|
||||
|
||||
// A string with the encoded mapping data.
|
||||
$sourceMap['mappings'] = $mappings;
|
||||
|
||||
if ($this->options['outputSourceFiles']) {
|
||||
// An optional list of source content, useful when the 'source' can't be hosted.
|
||||
// The contents are listed in the same order as the sources above.
|
||||
// 'null' may be used if some original sources should be retrieved by name.
|
||||
$sourceMap['sourcesContent'] = $this->getSourcesContent();
|
||||
}
|
||||
|
||||
// less.js compat fixes
|
||||
if (count($sourceMap['sources']) && empty($sourceMap['sourceRoot'])) {
|
||||
unset($sourceMap['sourceRoot']);
|
||||
}
|
||||
|
||||
return json_encode($sourceMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sources contents
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
protected function getSourcesContent()
|
||||
{
|
||||
if (empty($this->sources)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$content = array();
|
||||
|
||||
foreach ($this->sources as $sourceFile) {
|
||||
$content[] = file_get_contents($sourceFile);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the mappings string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateMappings()
|
||||
{
|
||||
if (! count($this->mappings)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$this->source_keys = array_flip(array_keys($this->sources));
|
||||
|
||||
// group mappings by generated line number.
|
||||
$groupedMap = $groupedMapEncoded = array();
|
||||
|
||||
foreach ($this->mappings as $m) {
|
||||
$groupedMap[$m['generated_line']][] = $m;
|
||||
}
|
||||
|
||||
ksort($groupedMap);
|
||||
$lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;
|
||||
|
||||
foreach ($groupedMap as $lineNumber => $line_map) {
|
||||
while (++$lastGeneratedLine < $lineNumber) {
|
||||
$groupedMapEncoded[] = ';';
|
||||
}
|
||||
|
||||
$lineMapEncoded = array();
|
||||
$lastGeneratedColumn = 0;
|
||||
|
||||
foreach ($line_map as $m) {
|
||||
$mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
|
||||
$lastGeneratedColumn = $m['generated_column'];
|
||||
|
||||
// find the index
|
||||
if ($m['source_file']) {
|
||||
$index = $this->findFileIndex($m['source_file']);
|
||||
|
||||
if ($index !== false) {
|
||||
$mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);
|
||||
$lastOriginalIndex = $index;
|
||||
// lines are stored 0-based in SourceMap spec version 3
|
||||
$mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);
|
||||
$lastOriginalLine = $m['original_line'] - 1;
|
||||
$mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);
|
||||
$lastOriginalColumn = $m['original_column'];
|
||||
}
|
||||
}
|
||||
|
||||
$lineMapEncoded[] = $mapEncoded;
|
||||
}
|
||||
|
||||
$groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';
|
||||
}
|
||||
|
||||
return rtrim(implode($groupedMapEncoded), ';');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the index for the filename
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return integer|false
|
||||
*/
|
||||
protected function findFileIndex($filename)
|
||||
{
|
||||
return $this->source_keys[$filename];
|
||||
}
|
||||
|
||||
protected function normalizeFilename($filename)
|
||||
{
|
||||
$filename = $this->fixWindowsPath($filename);
|
||||
$rootpath = $this->options['sourceMapRootpath'];
|
||||
$basePath = $this->options['sourceMapBasepath'];
|
||||
|
||||
// "Trim" the 'sourceMapBasepath' from the output filename.
|
||||
if (strpos($filename, $basePath) === 0) {
|
||||
$filename = substr($filename, strlen($basePath));
|
||||
}
|
||||
|
||||
// Remove extra leading path separators.
|
||||
if (strpos($filename, '\\') === 0 || strpos($filename, '/') === 0) {
|
||||
$filename = substr($filename, 1);
|
||||
}
|
||||
|
||||
return $rootpath . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix windows paths
|
||||
*
|
||||
* @param string $path
|
||||
* @param boolean $addEndSlash
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function fixWindowsPath($path, $addEndSlash = false)
|
||||
{
|
||||
$slash = ($addEndSlash) ? '/' : '';
|
||||
|
||||
if (! empty($path)) {
|
||||
$path = str_replace('\\', '/', $path);
|
||||
$path = rtrim($path, '/') . $slash;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
69
lib/vendor/scss/Type.class.php
vendored
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
/**
|
||||
* Block/node types
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Type
|
||||
{
|
||||
const T_ASSIGN = 'assign';
|
||||
const T_AT_ROOT = 'at-root';
|
||||
const T_BLOCK = 'block';
|
||||
const T_BREAK = 'break';
|
||||
const T_CHARSET = 'charset';
|
||||
const T_COLOR = 'color';
|
||||
const T_COMMENT = 'comment';
|
||||
const T_CONTINUE = 'continue';
|
||||
const T_CONTROL = 'control';
|
||||
const T_DEBUG = 'debug';
|
||||
const T_DIRECTIVE = 'directive';
|
||||
const T_EACH = 'each';
|
||||
const T_ELSE = 'else';
|
||||
const T_ELSEIF = 'elseif';
|
||||
const T_ERROR = 'error';
|
||||
const T_EXPRESSION = 'exp';
|
||||
const T_EXTEND = 'extend';
|
||||
const T_FOR = 'for';
|
||||
const T_FUNCTION = 'function';
|
||||
const T_FUNCTION_CALL = 'fncall';
|
||||
const T_HSL = 'hsl';
|
||||
const T_IF = 'if';
|
||||
const T_IMPORT = 'import';
|
||||
const T_INCLUDE = 'include';
|
||||
const T_INTERPOLATE = 'interpolate';
|
||||
const T_INTERPOLATED = 'interpolated';
|
||||
const T_KEYWORD = 'keyword';
|
||||
const T_LIST = 'list';
|
||||
const T_MAP = 'map';
|
||||
const T_MEDIA = 'media';
|
||||
const T_MEDIA_EXPRESSION = 'mediaExp';
|
||||
const T_MEDIA_TYPE = 'mediaType';
|
||||
const T_MEDIA_VALUE = 'mediaValue';
|
||||
const T_MIXIN = 'mixin';
|
||||
const T_MIXIN_CONTENT = 'mixin_content';
|
||||
const T_NESTED_PROPERTY = 'nestedprop';
|
||||
const T_NOT = 'not';
|
||||
const T_NULL = 'null';
|
||||
const T_NUMBER = 'number';
|
||||
const T_RETURN = 'return';
|
||||
const T_ROOT = 'root';
|
||||
const T_SCSSPHP_IMPORT_ONCE = 'scssphp-import-once';
|
||||
const T_SELF = 'self';
|
||||
const T_STRING = 'string';
|
||||
const T_UNARY = 'unary';
|
||||
const T_VARIABLE = 'var';
|
||||
const T_WARN = 'warn';
|
||||
const T_WHILE = 'while';
|
||||
}
|
70
lib/vendor/scss/Util.class.php
vendored
|
@ -1,70 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
use Leafo\ScssPhp\Base\Range;
|
||||
use Leafo\ScssPhp\Exception\RangeException;
|
||||
|
||||
/**
|
||||
* Utilty functions
|
||||
*
|
||||
* @author Anthon Pang <anthon.pang@gmail.com>
|
||||
*/
|
||||
class Util
|
||||
{
|
||||
/**
|
||||
* Asserts that `value` falls within `range` (inclusive), leaving
|
||||
* room for slight floating-point errors.
|
||||
*
|
||||
* @param string $name The name of the value. Used in the error message.
|
||||
* @param \Leafo\ScssPhp\Base\Range $range Range of values.
|
||||
* @param array $value The value to check.
|
||||
* @param string $unit The unit of the value. Used in error reporting.
|
||||
*
|
||||
* @return mixed `value` adjusted to fall within range, if it was outside by a floating-point margin.
|
||||
*
|
||||
* @throws \Leafo\ScssPhp\Exception\RangeException
|
||||
*/
|
||||
public static function checkRange($name, Range $range, $value, $unit = '')
|
||||
{
|
||||
$val = $value[1];
|
||||
$grace = new Range(-0.00001, 0.00001);
|
||||
|
||||
if ($range->includes($val)) {
|
||||
return $val;
|
||||
}
|
||||
|
||||
if ($grace->includes($val - $range->first)) {
|
||||
return $range->first;
|
||||
}
|
||||
|
||||
if ($grace->includes($val - $range->last)) {
|
||||
return $range->last;
|
||||
}
|
||||
|
||||
throw new RangeException("$name {$val} must be between {$range->first} and {$range->last}$unit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode URI component
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function encodeURIComponent($string)
|
||||
{
|
||||
$revert = array('%21' => '!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')');
|
||||
|
||||
return strtr(rawurlencode($string), $revert);
|
||||
}
|
||||
}
|
22
lib/vendor/scss/Version.class.php
vendored
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SCSSPHP
|
||||
*
|
||||
* @copyright 2012-2017 Leaf Corcoran
|
||||
*
|
||||
* @license http://opensource.org/licenses/MIT MIT
|
||||
*
|
||||
* @link http://leafo.github.io/scssphp
|
||||
*/
|
||||
|
||||
namespace Leafo\ScssPhp;
|
||||
|
||||
/**
|
||||
* SCSSPHP version
|
||||
*
|
||||
* @author Leaf Corcoran <leafot@gmail.com>
|
||||
*/
|
||||
class Version
|
||||
{
|
||||
const VERSION = 'v0.7.4';
|
||||
}
|
|
@ -18,9 +18,10 @@ if (!$force && !file_exists($needsUpdateFile))
|
|||
chdir(ROOT_DIR);
|
||||
|
||||
Shell::exec('git fetch && git reset --hard origin/master');
|
||||
Shell::exec('php composer.phar install');
|
||||
|
||||
View::compileCss();
|
||||
View::gzipAssets();
|
||||
|
||||
// clear cache
|
||||
Curl::get('localhost'.Controller::CACHE_CLEAR_PATH);
|
||||
Curl::get('localhost'.Controller::CACHE_CLEAR_PATH);
|
||||
|
|
|
@ -139,8 +139,11 @@ class View
|
|||
$scssCompiler->setLineNumberStyle(Leafo\ScssPhp\Compiler::LINE_COMMENTS);
|
||||
}
|
||||
|
||||
$css = $scssCompiler->compile(file_get_contents(self::SCSS_DIR . '/all.scss'));
|
||||
file_put_contents(self::CSS_DIR . '/all.css', $css);
|
||||
$all_css = $scssCompiler->compile(file_get_contents(self::SCSS_DIR . '/all.scss'));
|
||||
file_put_contents(self::CSS_DIR . '/all.css', $all_css);
|
||||
|
||||
$youtube_css = $scssCompiler->compile(file_get_contents(self::SCSS_DIR . '/youtube.scss'));
|
||||
file_put_contents(self::CSS_DIR . '/youtube.css', $youtube_css);
|
||||
}
|
||||
|
||||
public static function gzipAssets()
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
<?php
|
||||
Response::setCssAssets(['/css/yt2.css']);
|
||||
Response::setCssAssets(['/css/youtube.css']);
|
||||
Response::addJsAsset('/js/yt2/TweenMax.min.js');
|
||||
Response::addJsAsset('/js/yt2/ScrollToPlugin.min.js');
|
||||
Response::addJsAsset('/js/yt2/app.js');
|
||||
Response::addJsAsset('/js/yt2/FormValidation.js');
|
||||
Response::addJsAsset('/js/yt2/SyncStatus.js');
|
||||
Response::addJsAsset('/js/yt2/youtube_video.js');
|
||||
$reward = LBRY::youtubeReward();
|
||||
Response::setMetaTitle("LBRY YouTube Partner Program");
|
||||
Response::setMetaDescription("Put your content on the blockchain, experience true content freedom, and earn rewards.");
|
||||
?>
|
||||
|
@ -44,7 +43,7 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
|
||||
<div class="content">
|
||||
<?php
|
||||
if (isset($_GET['error'])): echo "<div>" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . "</div>";
|
||||
if ($error_message): echo "<div>" . "The following error occurred: ". $error_message . " For support please send an email to hello@lbry.io" . "</div>";
|
||||
endif;?>
|
||||
<div class="zigzag"></div>
|
||||
<h1>Create on a stable platform. For real this time.</h1>
|
||||
|
@ -77,8 +76,8 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
<div class="boxes">
|
||||
<div class="box">
|
||||
<div class="image" target="_blank">
|
||||
<div class="to-play" onclick="playVideo1()"><span></span></div>
|
||||
<video id="video1" width="100%" poster="/img/youtube/01@2x.jpg" src="https://spee.ch/1ac47b8b3def40a25850dc726a09ce23d09e7009/ever-wonder-how-bitcoin-and-other.mp4"/></video>
|
||||
<div id="play-video1" class="to-play" onclick="playVideo('video1')"><span></span></div>
|
||||
<video id="video1" width="100%" poster="/img/youtube/01@2x.jpg" src="https://spee.ch/1ac47b8b3def40a25850dc726a09ce23d09e7009/ever-wonder-how-bitcoin-and-other.mp4" style="cursor: pointer" onclick="this.paused ? this.play() : this.pause();"/></video>
|
||||
</div>
|
||||
|
||||
<div class="text">
|
||||
|
@ -87,8 +86,8 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
</div>
|
||||
<div class="box">
|
||||
<div class="image" target="_blank">
|
||||
<div class="to-play" onclick="playVideo2()"><span></span></div>
|
||||
<video id="video2" width="100%" poster="/img/youtube/02@2x.jpg" src="https://spee.ch/3c96f32de285db6c04e80bd6f5fad573250541e9/casually-successful.mp4"/></video>
|
||||
<div id="play-video2" class="to-play" onclick="playVideo('video2')"><span></span></div>
|
||||
<video id="video2" width="100%" poster="/img/youtube/02@2x.jpg" src="https://spee.ch/3c96f32de285db6c04e80bd6f5fad573250541e9/casually-successful.mp4" style="cursor: pointer" onclick="this.paused ? this.play() : this.pause();" /></video>
|
||||
</div>
|
||||
|
||||
<div class="text">
|
||||
|
@ -97,8 +96,8 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
</div>
|
||||
<div class="box">
|
||||
<div class="image" target="_blank">
|
||||
<div class="to-play" onclick="playVideo3()"><span></span></div>
|
||||
<video id="video3" width="100%" poster="/img/youtube/03@2x.jpg" src="https://spee.ch/8958c5d573d71f5c2d0c1bfdf752737ce39744cb/the-historical-elements-of-wolfenstein.mp4"></video>
|
||||
<div id="play-video3" class="to-play" onclick="playVideo('video3')"><span></span></div>
|
||||
<video id="video3" width="100%" poster="/img/youtube/03@2x.jpg" src="https://spee.ch/8958c5d573d71f5c2d0c1bfdf752737ce39744cb/the-historical-elements-of-wolfenstein.mp4" style="cursor: pointer" onclick="this.paused ? this.play() : this.pause();"></video>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p>@ColinsLastStand</p>
|
||||
|
@ -139,10 +138,26 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
<div class="zigzag"></div>
|
||||
<h1>Sync & Earn</h1>
|
||||
<p>LBRY offers a single-click sync process<br>for existing YouTubers</p>
|
||||
<form class="form" id="sync" method="post" action="http://api.lbry.io/yt/connect">
|
||||
<div class="form-inner">
|
||||
<div class="block">
|
||||
<div class="center">
|
||||
<input type="text" hidden name="type" value="sync"/>
|
||||
<input id="immediate-sync" name="immediate_sync" type="checkbox" value="true"/>
|
||||
<label for="immediate-sync">I want to sync my content.</label></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block">
|
||||
<div class="center">
|
||||
<input type="submit" value="Sync Now"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="button">
|
||||
<a href="https://api.lbry.io/yt/connect?type=sync&immediate_sync=true">Sync now</a>
|
||||
</div>
|
||||
<div class="meta">
|
||||
By syncing, you agree to mirror your content to the LBRY network for 1 year, and acknowledge <a href="/faq/youtube-terms">these terms</a>.
|
||||
</div>
|
||||
|
@ -153,7 +168,7 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
<div class="inner">
|
||||
<div class="content">
|
||||
<h1>LBRY Credits and Your Channel</h1>
|
||||
<p>After you sync, receive LBRY Credits every month for one year based on your current subscriber count.<br/><br/>
|
||||
<p>After you sync, receive LBRY Credits for one year based on your current subscriber count.<br/><br/>
|
||||
The more you give to the network, the more it gives back.</p>
|
||||
<div class="price">
|
||||
<h3>Partner Programs</h3>
|
||||
|
@ -162,7 +177,7 @@ Response::setMetaDescription("Put your content on the blockchain, experience tru
|
|||
<div class="table">
|
||||
<div class="head">
|
||||
<p>Subscribers</p>
|
||||
<p>Monthly</p>
|
||||
<p>Yearly</p>
|
||||
<p>Amount</p>
|
||||
</div>
|
||||
<div class="line">
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<?php
|
||||
$status_token = $_POST['status_token'];
|
||||
$channel_name = $_POST['new_preferred_channel'];
|
||||
$email = $_POST['new_email'];
|
||||
$status_token = Request::encodeStringFromUser($_POST['status_token']);
|
||||
$channel_name = Request::encodeStringFromUser($_POST['new_preferred_channel']);
|
||||
$email = Request::encodeStringFromUser($_POST['new_email']);
|
||||
$sync_consent = isset($_POST['sync_consent']);
|
||||
|
||||
$current_value = LBRY::statusYoutube($status_token);
|
||||
|
||||
if(!preg_match("/@[A-Za-z0-9_-]+$/", $channel_name)){
|
||||
$channel_name = "@" . $channel_name;
|
||||
}
|
||||
|
||||
AcquisitionActions::actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent, $current_value);
|
||||
AcquisitionActions::actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent);
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
<?php Response::setMetaDescription('YouTuber? Take back control! LBRY allows publication on your terms. It\'s open-source, decentralized, and gives you 100% of the profit.') ?>
|
||||
<?php Response::setMetaTitle(__('YouTubers! Take back control.')) ?>
|
||||
<?php Response::setCssAssets(['/css/yt2.css']) ?>
|
||||
<?php Response::setCssAssets(['/css/youtube.css']) ?>
|
||||
<?php Response::addJsAsset('/js/yt2/FormValidation.js')?>
|
||||
<?php Response::addJsAsset('/js/yt2/youtube_status.js') ?>
|
||||
<?php Response::addJsAsset('/js/yt2/youtube_video.js')?>
|
||||
<?php $statusResponse = LBRY::statusYoutube($token); ?>
|
||||
<?php $statusData = $statusResponse['data'] ?>
|
||||
<?php $isSyncAgreed = false ?>
|
||||
<?php $statusData = $status_token['data'] ?>
|
||||
<?php $isSyncAgreed = in_array($statusData['status'], ["syncing", "synced", "queued"]) ?>
|
||||
<?php $isRewardClaimed = $statusData['is_reward_claimed'] ?? false ?>
|
||||
<?php if (IS_PRODUCTION): ?>
|
||||
<?php js_start() ?>
|
||||
if(!localStorage.getItem('status_token')){
|
||||
ga('send', 'event', 'YT Sync', '<?php echo $isSyncAgreed ? "pending" : "queued" ?>', '');
|
||||
}
|
||||
<?php js_end() ?>
|
||||
<?php endif ?>
|
||||
|
||||
<main class="channel-settings">
|
||||
<?php echo View::render('acquisition/_youtube_header') ?>
|
||||
<section class="section channel pad-top">
|
||||
|
@ -36,7 +43,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="blocks">
|
||||
<div class="block">
|
||||
<p>Your Sync Status<br>
|
||||
|
@ -79,7 +86,7 @@
|
|||
<input type="hidden" name="status_token" id="status_token" value="<?php echo $token?>"/>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($_GET['error'])): echo "<div>" . "The following error occurred: ". $_GET['error_message'] . " For support please send an email to hello@lbry.io" . "</div>";
|
||||
if ($error_message): echo "<div>" . "The following error occurred: ". $error_message . " For support please send an email to hello@lbry.io" . "</div>";
|
||||
endif;?>
|
||||
<div class="block">
|
||||
<label for="channel-name">LBRY Channel ID</label>
|
||||
|
@ -102,4 +109,4 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
|
|
11
view/template/acquisition/youtube_status_redirect.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php js_start() ?>
|
||||
if(localStorage.getItem('status_token')){
|
||||
var status_token = localStorage.getItem('status_token');
|
||||
url = '/youtube/status/' + status_token;
|
||||
$(location).attr('href', url);
|
||||
}
|
||||
|
||||
else{
|
||||
$(location).attr('href', '/youtube');
|
||||
}
|
||||
<?php js_end() ?>
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$desired_lbry_channel_name = $_POST['desired_lbry_channel_name'];
|
||||
$desired_lbry_channel_name = Request::encodeStringFromUser($_POST['desired_lbry_channel_name']);
|
||||
|
||||
if(!preg_match("/@[A-Za-z0-9_-]+$/", $desired_lbry_channel_name)){
|
||||
$desired_lbry_channel_name = "@" . $desired_lbry_channel_name;
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
<?php js_end() ?>
|
||||
<?php endif ?>
|
||||
<br/>
|
||||
<span class="meta">
|
||||
<?php echo $version ?>,
|
||||
<span class="meta"> Latest Version :
|
||||
<?php echo $version ?>, Download Size :
|
||||
<?php echo number_format($size, 1) ?> MB,
|
||||
built on <?php echo date('F d', $releaseTimestamp) ?>
|
||||
at <?php echo date('H:i:s', $releaseTimestamp) ?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<meta name="google-site-verification" content="QEyIHPbSKR2Z9ZNkfVHGdGv5EE7tTM7FE0Wt8tmcH50" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
<?php $title = Response::getMetaTitle() ?: Response::guessMetaTitle($content) ?>
|
||||
<?php $title = $title ?
|
||||
|
|
34
view/template/page/android-alpha.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php Response::setMetaDescription(__('description.android-alpha')) ?>
|
||||
<?php Response::setMetaTitle(__('title.android-alpha')) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => true, 'isAbsolute' => true]) ?>
|
||||
<main>
|
||||
<div class="cover cover-dark cover-center cover-full cover--dark-overlay" style="background-image: url(/img/droid1.jpg)">
|
||||
<div class="content content-dark text-center">
|
||||
<h1 class="cover-title cover-title-tile cover-item--outline">
|
||||
Testing... Testing...
|
||||
</h1>
|
||||
<h3 class="cover-item--outline">
|
||||
LBRY needs alpha testers for our Android app!
|
||||
</h3>
|
||||
<div class="spacer1">
|
||||
<a href="#about" class="btn-primary btn-large">Tell Me More!</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cover cover-light" id="about">
|
||||
<div class="content content-light content-readable">
|
||||
<h3>Want to help build the first ever decentralized, blockchain based media streaming app?</h3>
|
||||
<p> We're looking for developers who can help us get our Android app ready for prime time.</p>
|
||||
<h3>How do I get involved?</h3>
|
||||
<p>Enter your email below. We'll put you in our testing queue (please note that you will <b>not</b> receive an email right away) and send you everything you need to get started when you reach the top.</p>
|
||||
<?php echo View::render('mail/_subscribeForm', [
|
||||
'tag' => 'android-alpha',
|
||||
'submitLabel' => 'Make Me an Alpha Tester!',
|
||||
'hideDisclaimer' => true,
|
||||
'largeInput' => true,
|
||||
'btnClass' => 'btn-alt btn-large',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer') ?>
|
21
view/template/page/pewpewpew.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php Response::setMetaDescription(__('description.guns')) ?>
|
||||
<?php Response::setMetaTitle(__('title.guns')) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => true, 'isAbsolute' => true]) ?>
|
||||
<main>
|
||||
<div class="cover cover-dark cover-center cover-full cover--dark-overlay" style="background-image:url(/img/firearm.jpg); min-height: 40vh !important; max-height: 60vh">
|
||||
</div>
|
||||
<div class="cover cover-light" id="about">
|
||||
<div class="content content-light content-readable">
|
||||
<h2>It’s tough being a gun owner in 2018.</h2>
|
||||
|
||||
<p>That’s one of the many reasons we’re building LBRY for everyone. LBRY is decentralized, which means there’s no secret panel that gets to decide what is and isn’t acceptable. As long as your videos are legal, they’ll stay up. If people like your videos, they can tip you immediately right in the app.
|
||||
</p>
|
||||
|
||||
<p>And to those who think they can restrict our free speech? Molṑn labé.</p>
|
||||
|
||||
<p>You can <a href="/get?src=FA">download the LBRY app here.</a> If you have any questions or need help, <a href="http://chat.lbry.io">join our Discord community.</a></p>
|
||||
<div class="text-center"><a href="/get?src=FA" class="btn-primary btn-large">Get LBRY App</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer') ?>
|
37
view/template/page/speech-admin.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php Response::setMetaDescription(__('description.speech-admin')) ?>
|
||||
<?php Response::setMetaTitle(__('title.speech-admin')) ?>
|
||||
<?php echo View::render('nav/_header', ['isDark' => true, 'isAbsolute' => true]) ?>
|
||||
<main>
|
||||
<div class="cover cover-dark cover-center cover-full cover--dark-overlay" style="background-image: url(/img/speech-admin.jpg)">
|
||||
<div class="content content-dark text-center">
|
||||
<h1 class="cover-title cover-title-tile cover-item--outline">
|
||||
Fork For Freedom
|
||||
</h1>
|
||||
<h3 class="cover-item--outline">
|
||||
Join the battle for free speech on the internet. Your weapon? A keyboard. Your armor? A decentralized content marketplace protocol.
|
||||
</h3>
|
||||
<div class="spacer1">
|
||||
<a href="#about" class="btn-primary btn-large">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cover cover-light" id="about">
|
||||
<div class="content content-light content-readable">
|
||||
<h3>You'd like us to stop being vaguely provocative and just explain?</h3>
|
||||
<p>Fine.</p>
|
||||
<p>spee.ch is a free, open-source web portal for LBRY content. It both publishes content to the LBRY network and serves data from the LBRY network, but it does it over the web for improved usability.</p>
|
||||
<p>Recently, spee.ch has been re-engineered to support self-hosting and custom skinning, as well as hosting only a portion of the network. You could run a spee.ch fork that's dedicated specifically to your favorite cat and has the appearance to show it.</p>
|
||||
<h3This is where you come in.</h3>
|
||||
<p>This functionality is brand new and we're offering LBC bounties to those who can help us test and refine it. If you're capable of installing Wordpress, you're probably capable of installing spee.ch</p>
|
||||
<p>So if you want to play around with a funky new technology, contribute to content freedom, and earn weird internet tokens, join us for an introductory session! We'll explain more about the program and walk you through the basics of how spee.ch works and how to set it up.</p>
|
||||
<?php echo View::render('mail/_subscribeForm', [
|
||||
'tag' => 'speech-admin',
|
||||
'submitLabel' => 'Sign Me Up',
|
||||
'hideDisclaimer' => true,
|
||||
'largeInput' => true,
|
||||
'btnClass' => 'btn-alt btn-large',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php echo View::render('nav/_footer') ?>
|
1476
web/css/yt2.css
BIN
web/img/droid1.jpg
Normal file
After Width: | Height: | Size: 246 KiB |
BIN
web/img/firearm.jpg
Executable file
After Width: | Height: | Size: 369 KiB |
BIN
web/img/speech-admin.jpg
Normal file
After Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 68 KiB |
|
@ -63,7 +63,7 @@ function validateEmail(email) {
|
|||
}
|
||||
|
||||
function validateLBRYName(lbry_channel_name){
|
||||
var re = /[@A-Za-z0-9_-]+$/;
|
||||
var re = /^[@A-Za-z0-9_-]*$/g;
|
||||
return re.test(lbry_channel_name);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +1,8 @@
|
|||
|
||||
function playVideo1(){
|
||||
var myVideo = document.getElementById("video1");
|
||||
if (myVideo.paused){
|
||||
myVideo.play();
|
||||
}
|
||||
else{
|
||||
myVideo.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function playVideo2(){
|
||||
var myVideo = document.getElementById("video2");
|
||||
if (myVideo.paused){
|
||||
myVideo.play();
|
||||
}
|
||||
else{
|
||||
myVideo.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function playVideo3() {
|
||||
var myVideo = document.getElementById("video3");
|
||||
if (myVideo.paused) {
|
||||
myVideo.play();
|
||||
}
|
||||
else {
|
||||
myVideo.pause();
|
||||
}
|
||||
function playVideo(id){
|
||||
var myVideo = document.getElementById(id);
|
||||
|
||||
myVideo.play();
|
||||
$('#' + id).prop("controls", true);
|
||||
$('#play-' + id).hide();
|
||||
}
|