bstrahija / assets-ci Goto Github PK
View Code? Open in Web Editor NEWSimple assets library for CodeIgniter. Ability to combine, minify and use the Less syntax.
Home Page: http://creolab.hr
Simple assets library for CodeIgniter. Ability to combine, minify and use the Less syntax.
Home Page: http://creolab.hr
Hello, I'm getting this error when attempting to minify my css
Fatal error: Class 'CoffeeScript\yy_Base' not found in /Applications/MAMP/mysite/application/third_party/assets/CoffeeScript/yy/While.php on line 6
Any suggestions?
Version in spark.info says "0.6.2" and in assets.php it still says "0.6.1" which results in errors like:
Severity: Warning
Message: include(sparks/assets/0.6.1/libraries/jsmin.php) [function.include]: failed to open stream: No such file or directory
Filename: libraries/Assets.php
Line Number: 68
CSSMin has a number of config options -see here: http://code.google.com/p/cssmin/wiki/MinifierConfiguration.
Do you think we could have them included in the "assets" config file somehow - so we can set them there?
I'm forced to alter the library with my cssmin config - because the default config breaks my css during minification.
Either way - great library - thanks!
Hi,
I think there is a bug/possible design flaw:
Scenario: "auto_clear_cache = true"
Page 1:
css_group ("page1", "page1.css")
Page 2:
css_group ("page 2", "page2.css")
When you visit page 1, Page 2 CSS is deleted (because it created a new cache). When you visit Page 2, Page 1 cache is deleted (since you made a new cache). This continues on forever, unless you notice!!!!
This is poorly designed - perhaps it should be only delete Page 1 css file and vice versa?
Hi,
I just started using your code and my first impress is very good. Thank you so much!
I have a question.
If I want to merge the angular js code and my script.js, how can I do that?
I tried this way
but after that had been merged and packed, the code didn't work.
I can use this way
<script src="assets/js/vendor/angular-1.2.26/angular.min.js"></script>but I will get 2 js file with this.
Any idea, suggestion?
Thank you,
L
The less compiler used has been updated to version 0.3.8 which supposedly fixes the Bootstrap problem.
If you replace the assets (0.3.7) version with the new one, CodeIgniter bombs.
Any chance of incorporating it? Thanks
adding an option to load or not to load the coffee library files ..
for example am using a pure css and js files so i dont need it to load the coffee library ( and its a huge number of files to be honest ) ..
so i think it will be nice if we have put an option to load it or not load it ..
I am using the following template library:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template {
var $template_data = array();
function set($name, $value)
{
$this->template_data[$name] = $value;
}
function view($view, $view_data = array(), $return = FALSE)
{
$this->CI =& get_instance();
$this->load('template', $view, $view_data, $return);
}
function load($template = '', $view = '' , $view_data = array(), $return = FALSE)
{
$this->CI =& get_instance();
$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
return $this->CI->load->view($template, $this->template_data, $return);
}
}
When I render a template with a call to $this->template->view(), the images loaded in the partial get root paths (i.e. /image.png) causing them to be inaccessible, whereas images in the template get rendered with the full and appropriate path/url (i.e. http://sub.domain.tld/assets/img/image.png).
Any idea as to why this would be occuring?
After source-diving a bit in assets.php, it appears as though _set_path() does not get called when rendering the partial but waits until the template gets rendered. However, the Assets::img function gets called when rendering the partial and returns a root path because self::$img_url
is null. Thus, after this line $img_path = reduce_double_slashes(self::$img_url.'/'.$path);
, $img_path
is just '/img_name.ext'.
I found that changing Assets::img
to call self::init();
at the top of its scope fixes the issue.
Assets::img
now looks like this:
<?php
/**
* Return url to image, or event an entire tag
* @param string $path
*/
public static function img($path = null, $tag = false, $properties = null)
{
self::init(); // ADDED THIS LINE
$img_path = reduce_double_slashes(self::$img_url.'/'.$path);
// Properties
if ($properties) $properties['src'] = $img_path;
log_message('error', $img_path);
// Tag?
if ($tag) return img($properties);
else return $img_path;
}
?>
Hi i am using this library its great but facing one problem while minify twitter bootstrap css its not showing pull-right css at all in minified css, i have used this library in my two projects with twitter bootstrap facing same problem.
When CSS is called like this is a view:
<? Assets::css_group('application', array('application.css', 'vendor.css')); ?>
Image URLs are given absolute paths, so if an image path is specified in the CSS as:
.selector {
background-image: url('/assets/img/ui/header-logo.png');
}
it becomes something like this:
.selector {
background-image: url('http://10.0.0.43/assets/img/ui/header-logo.png');
}
So when developing and testing the site on different machines and devices, some with localhost some with an IP address, these links break on one or the other... depending on which visited first and created a the CSS in the cache.
Is there a way to turn this off?
Hi, i am using assets library but css background image path is not comming proper, my css image path is css/theme/default/d.png
see how it is coming
http://localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default///localhost/qahtan/application/themes/admin/assets/css/themes/default/d.png
actual path is this
localhost/qahtan/application/themes/admin/assets/css/themes/default/d.png
Shoudnt line 988 be
"if (self::$minify_css and ! self::$freeze and ! self::$_cssmin_loaded)"
instead of
"if (self::$minify_js and ! self::$freeze and ! self::$_cssmin_loaded)"
?
I am in the process of upgrading to 2.1.0 and after following the instructions in the CodeIgniter documentation I now get the following error:
Fatal error: Call to undefined function display_css()
It would appear the problem is only when this spark is being autoloaded. So I believe it is something to do with the Sparks ci_autoloader and not an asset related issue.
libraries/assets.php on Line: 613
$new_href = str_replace("http://", "//", $new_href);
This code causes problem that IE can't load url.
reference: http://stackoverflow.com/questions/7408189/protocol-relative-url-in-css-for-multiple-subdomains
I don't know if this is the correct place for this, but I've just updated to the latest version of the LESS compiler (0.3.9) from leafo.net/lessphp and it now works fine with the latest version of Bootstrap (2.3.1).
bootstrap.less and responsive.less now compile correctly.
I use SSL a lot on my apps and it'd be great if you could either provide a flag to use //
instead of http://
or a flag to force SSL on all.
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false&callback=init"></script>
I did everything OK to load the assets into codeigniter but i cant seem to let the thing work.
If i do an var_dump on the thing it says OK and the boolean returnetd is true.
The current error i get is: Fatal error: Class 'Assets' not found in /home/lemondev/public_html/lemoncms/application/views/welcome_message.php on line 8
What to do now? :(
I also work with HMVC and set every right.. help me please!
Hello!
Im trying to install and configure your library but app breaks on Assets:css function.
Only a blank page.
Im using HMVC and a template library.
Ty for your support.
hi,
am using version 1.5.0. and the first time i execute the page i got this error
A PHP Error was encountered
Severity: Runtime Notice
Message: Creating default object from empty value
Filename: libraries/assets.php
Line Number: 771
and it will goes away once the info.cache was created ..
is there a way to combine the css files without combine the js ?? since the config option combine everything when you turn it on .
i was wondering since you didnt push the version yet ..
why not to add an option which will help to add a prefix to the combined ( or the single ) cached files, instead of using the time stamp ..
i will try to do it if you like me to help ...
A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$js
Filename: libraries/assets.php
Line Number: 833
Backtrace:
File: app\libraries\assets.php
Line: 833
Function: _exception_handler
File: app\libraries\assets.php
Line: 189
Function: _generate_tags
i tried everything but i got this all the time
ps : am using CI 3.0-dev
This is the first time I have ever used github, so apologies if this is not the correct place for asking questions (if so, perhaps you could point me in the right direction).
I've just setup assets in my CI project and it's great. However, I can't work out how to make use of the LESSPHP facility. I've use it outside of CI in the past, but I'm new to CI also.
Where would I put the .less files and what's the command to compile the .less to .css?
Any pointers would be much appreciated.
Thanks.
is there any need for [ if statement ] on line [294]
// Combine
if ($type == 'css' and $this->less_css)
{
//$data .= $contents;
$data .= $this->_process($contents, $type, 'minify', $base_url);
}
else
{
$data .= $this->_process($contents, $type, 'minify', $base_url);
}
i still think its the same with or without the if
hi:
i have just downloaded your latest code ..
for some reason the cache was auto cleared whenever i go to a new page
here is my cache config options :
<?php
$config['assets']['auto_clear_cache'] = false;
$config['assets']['auto_clear_css_cache'] = false;
$config['assets']['auto_clear_js_cache'] = false;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.