Changeset 843378
- Timestamp:
- 01/22/2014 10:26:22 PM (12 years ago)
- Location:
- edge-suite/trunk
- Files:
-
- 5 edited
-
admin/options.php (modified) (1 diff)
-
edge-suite.php (modified) (3 diffs)
-
includes/edge-suite-comp-builder.inc (modified) (3 diffs)
-
includes/edge-suite-comp.inc (modified) (3 diffs)
-
includes/edge-wordpress.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
edge-suite/trunk/admin/options.php
r632663 r843378 51 51 <span class="setting-description"> 52 52 File size in MB<br/> 53 This is the max size that your file uploads will be limited to. 2MB is the default upload size.<br>53 This is the max size that your file uploads will be limited to. 5 MB is the default upload size.<br> 54 54 <?php print $file_size_hint; ?> 55 55 </span> -
edge-suite/trunk/edge-suite.php
r665554 r843378 52 52 53 53 54 define('EDGE_SUITE_ALLOWED_ASSET_EXTENSIONS', 'js|png|jpg|gif|svg|css ');54 define('EDGE_SUITE_ALLOWED_ASSET_EXTENSIONS', 'js|png|jpg|gif|svg|css|html|woff|eot|ttf|mp3|ogg|oga|wav|m4a|aac'); 55 55 56 56 … … 92 92 add_option('edge_suite_debug', 0); 93 93 94 // Create main edge suite directory.95 mkdir_recursive(trailingslashit(EDGE_SUITE_PUBLIC_DIR));96 94 } 97 95 … … 381 379 } 382 380 383 function edge_suite_comp_view_inline($definition_id, $css_style = '' ){384 385 $definition_res = edge_suite_comp_render($definition_id, $css_style );381 function edge_suite_comp_view_inline($definition_id, $css_style = '', $data = array()){ 382 383 $definition_res = edge_suite_comp_render($definition_id, $css_style, $data); 386 384 387 385 $stage = $scripts = ''; -
edge-suite/trunk/includes/edge-suite-comp-builder.inc
r696403 r843378 365 365 // Check if there were multiple main js files. 366 366 if (count($main_edge_files) > 0) { 367 $msg_dir = substr($this->tmpDir, strlen($this->tmpDirBase));368 // drupal_set_message('Multiple edge.js files found. Everything outside ' . $msg_dir . ' will be ignored.');367 // $msg_dir = substr($this->tmpDir, strlen($this->tmpDirBase)); 368 // $msg = 'Multiple edge.js files found. Everything outside ' . $msg_dir . ' will be ignored.'; 369 369 } 370 370 } … … 431 431 // Replace alterRegisterCompositionDefn() with custom call to alter 432 432 // symbols and fonts. 433 $register_pattern = '/Edge.registerCompositionDefn\(compId,\s?symbols,\s?fonts,\s?resources\);/'; 434 $register_replace = 'AdobeEdge.alterRegisterCompositionDefn(compId, symbols, fonts, resources, Edge.registerCompositionDefn);'; 435 $content = preg_replace($register_pattern, $register_replace, $content); 433 $register_pattern = '/Edge.registerCompositionDefn\(compId,\s?symbols,\s?fonts,\s?resources(,\s?opts)?\);/'; 434 $register_replace = 'AdobeEdge.alterRegisterCompositionDefn(compId, symbols, fonts, resources, opts, Edge.registerCompositionDefn);'; 435 $register_pattern_found = 0; 436 $content = preg_replace($register_pattern, $register_replace, $content, $register_pattern_found); 436 437 437 438 // Write modified file. … … 675 676 */ 676 677 protected function moveEdgeFiles($src, $dest) { 677 global $wp_filesystem; 678 // TODO: Test. 679 $allowed_extensions = 'js,png,jpg,gif,svg,css,html'; 680 // Strip spaces. 681 $allowed_extensions = str_replace(' ', '', $allowed_extensions); 682 // Replace commas. 683 $allowed_extensions = str_replace(',', '|', $allowed_extensions); 684 // Check if list is valid. 685 if (!preg_match('/^([a-zA-Z0-9]{2,6}\|)*([a-zA-Z0-9]{2,6})$/', $allowed_extensions)) { 686 $allowed_extensions = 'js|png|jpg|gif|svg|css|html'; 687 } 688 689 $files = file_scan_directory($src, '/\.(' . $allowed_extensions . ')$/'); 678 679 $files = file_scan_directory($src, '/\.(' . EDGE_SUITE_ALLOWED_ASSET_EXTENSIONS . ')$/'); 690 680 // TODO: Does this work with nested folders? 691 681 // Todo: Check mimetype. Are mime types calculated from the file extension? -
edge-suite/trunk/includes/edge-suite-comp.inc
r632663 r843378 86 86 87 87 $definition_id = $def_record['definition_id']; 88 if($definition_id == 0){ 89 throw new Exception('Definition id of 0, database entry could not be created.'); 90 } 88 91 $def_name = edge_suite_comp_unique_name($def_record); 89 92 … … 219 222 * Array with stage content and header scripts. 220 223 */ 221 function edge_suite_comp_render($definition_id, $styles = '' ) {224 function edge_suite_comp_render($definition_id, $styles = '', $data = array()) { 222 225 $scripts = array(); 223 226 $stage = ''; … … 268 271 } 269 272 273 // Generate JSON data for more advanced animations, if supplied. 274 $data_string = ''; 275 if (isset($data) && !empty($data)) { 276 $data_string = '<script class="data" type="text/data">' . json_encode($data) . '</script>'; 277 } 278 270 279 // Put everything together. 271 $stage = '< div id="' . $div_id . '" style="' . $height . $width . $styles . '" class="' . $definition->composition_id . '">' . '</div>';280 $stage = '<p><div id="' . $div_id . '" style="' . $height . $width . $styles . '" class="' . $definition->composition_id . '">' . $data_string . '</div></p>'; 272 281 273 282 } -
edge-suite/trunk/includes/edge-wordpress.js
r707018 r843378 20 20 * Edge composition id 21 21 */ 22 AdobeEdge.alterRegisterCompositionDefn = function (compId, symbols, fonts, resources, registerCompositionDefn) { 23 22 AdobeEdge.alterRegisterCompositionDefn = function (compId, symbols, fonts, resources, opts, registerCompositionDefn) { 24 23 // Check if one of the know patterns for the stage id can be found. 25 24 var stage_name = ""; … … 54 53 } 55 54 56 for (var key in symbols) {57 var dom = null;58 // not minified version59 if (symbols[key].content != undefined && symbols[key].content.dom != undefined) {60 dom = symbols[key].content.dom;61 }62 // minified version63 else if (symbols[key].cn != undefined && symbols[key].cn.dom != undefined) {64 dom = symbols[key].cn.dom;65 }66 if(dom != null){67 AdobeEdge.alterDomPaths(dom, compId);68 }69 }55 for (var key in symbols) { 56 var dom = null; 57 // not minified version 58 if (symbols[key].content != undefined && symbols[key].content.dom != undefined) { 59 dom = symbols[key].content.dom; 60 } 61 // minified version 62 else if (symbols[key].cn != undefined && symbols[key].cn.dom != undefined) { 63 dom = symbols[key].cn.dom; 64 } 65 if(dom != null){ 66 AdobeEdge.alterDomPaths(dom, compId); 67 } 68 } 70 69 71 70 … … 77 76 } 78 77 79 registerCompositionDefn(compId, symbols, fonts, resources); 78 // Legacy opts parameter. 79 if (typeof registerCompositionDefn === 'undefined' && typeof opts === 'function'){ 80 registerCompositionDefn = opts; 81 opts = null; 82 registerCompositionDefn(compId, symbols, fonts, resources); 83 } 84 else { 85 registerCompositionDefn(compId, symbols, fonts, resources, opts); 86 } 80 87 81 88 } … … 112 119 if (fillProp != null && fillProp.length > 1 && fillProp[1] != null && typeof fillProp[1] == 'string' && fillProp[1].match(/\.(js|png|jpg|svg|gif)$/)) { 113 120 fillProp[1] = AdobeEdge.pathPrefix.comps[compId] + '/' + fillProp[1]; 121 } 122 123 // Handle audio files. 124 if (dom[key].hasOwnProperty('t') && dom[key].hasOwnProperty('sr') && dom[key].t === 'audio') { 125 var audio_sources = dom[key].sr; 126 for (var a = 0; a < audio_sources.length; a++) { 127 if(audio_sources[a].match(/\.(mp3)$/)) { 128 audio_sources[a] = AdobeEdge.pathPrefix.comps[compId] + '/' + audio_sources[a]; 129 } 130 } 114 131 } 115 132 … … 145 162 for (var prop in obj) { 146 163 if (typeof(obj[prop]) == 'string') { 147 if ( obj[prop].substr(obj[prop].length - 3) === ".js") {164 if (!obj[prop].match(/^(?:https?:)?\/\//) && obj[prop].substr(obj[prop].length - 3) === ".js") { 148 165 // If the file is a general edge library, add the lib path prefix. 149 166 if (obj[prop].substr(0, "edge_includes/".length) === "edge_includes/") {
Note: See TracChangeset
for help on using the changeset viewer.