Added robo task to generate edited tooltip script from Bootstrap source.
This commit is contained in:
1 parent
174b171cdd
commit
e42787ec16
1 file changed
+23
@@ -29,4 +29,27 @@ class RoboFile extends \Robo\Tasks {
|
||||
|
||||
$this->taskExec( 'lessc css/laps.less css/laps.css' )->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies tooltip.js from Bootstrap sources and edits plugin name.
|
||||
*/
|
||||
public function tooltip() {
|
||||
|
||||
$tooltip = 'js/tooltip.js';
|
||||
|
||||
$this->taskWriteToFile( $tooltip )
|
||||
->textFromFile( 'vendor/twbs/bootstrap/js/tooltip.js' )
|
||||
->run();
|
||||
|
||||
$replacements = array(
|
||||
'+function ($) {' => '// modified to use lapstooltip as plugin name' . "\n\n" . '+function ($) {',
|
||||
'this.init(\'tooltip\'' => 'this.init(\'lapstooltip\'',
|
||||
'bs.tooltip' => 'bs.lapstooltip',
|
||||
'$.fn.tooltip' => '$.fn.lapstooltip',
|
||||
);
|
||||
|
||||
foreach ( $replacements as $from => $to ) {
|
||||
$this->taskReplaceInFile( $tooltip )->from( $from )->to( $to )->run();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user